diff --git a/spec/changelog.yml b/spec/changelog.yml index a4506f743..02c3fb9c7 100644 --- a/spec/changelog.yml +++ b/spec/changelog.yml @@ -24,9 +24,9 @@ link: https://github.com/elastic/package-spec/pull/607 - version: 2.12.1-next changes: - - description: Prepare for next version + - description: Allow to define expected values in fields definitions. type: enhancement - link: https://github.com/elastic/package-spec/pull/612 + link: https://github.com/elastic/package-spec/pull/616 - description: Add support for structured errors type: enhancement link: https://github.com/elastic/package-spec/pull/609 diff --git a/spec/integration/data_stream/fields/fields.spec.yml b/spec/integration/data_stream/fields/fields.spec.yml index 04f6011e2..3c3a2e02e 100644 --- a/spec/integration/data_stream/fields/fields.spec.yml +++ b/spec/integration/data_stream/fields/fields.spec.yml @@ -92,6 +92,12 @@ spec: description: Short description of field type: string + expected_values: + description: An array of expected values for the field. When defined, these are the only expected values. + type: array + items: + type: string + value: description: The value to associate with a constant_keyword field. type: string diff --git a/test/packages/good_v2/data_stream/foo/fields/some_fields.yml b/test/packages/good_v2/data_stream/foo/fields/some_fields.yml index 6271061cf..3c3611dd5 100644 --- a/test/packages/good_v2/data_stream/foo/fields/some_fields.yml +++ b/test/packages/good_v2/data_stream/foo/fields/some_fields.yml @@ -86,3 +86,8 @@ metrics: - min - max +- name: enum + type: keyword + expected_values: + - artifact + - directory