Skip to content

Commit

Permalink
Allow to define expected values in fields definitions (#616)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsoriano authored Sep 27, 2023
1 parent 0b41554 commit 4253eff
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spec/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions spec/integration/data_stream/fields/fields.spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions test/packages/good_v2/data_stream/foo/fields/some_fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,8 @@
metrics:
- min
- max
- name: enum
type: keyword
expected_values:
- artifact
- directory

0 comments on commit 4253eff

Please sign in to comment.