Skip to content

Commit

Permalink
set value required in constant_keyword field type
Browse files Browse the repository at this point in the history
Signed-off-by: kewei.11 <[email protected]>
  • Loading branch information
kkewwei committed Jul 15, 2024
1 parent 0b033a9 commit 96cf20d
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
1 change: 1 addition & 0 deletions spec/schemas/_common.mapping.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,7 @@ components:
- constant_keyword
required:
- type
- value
FieldAliasProperty:
allOf:
- $ref: '#/components/schemas/PropertyBase'
Expand Down
37 changes: 37 additions & 0 deletions tests/indices/constant_keyword.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
$schema: ../../json_schemas/test_story.schema.yaml

description: Test constant_keyword field type and retrieving a doc.

prologues:
- path: /{index}
method: PUT
parameters:
index: games
- path: /{index}
method: PUT
parameters:
index: movies
request_body:
payload:
mappings:
properties:
genre:
type: constant_keyword
value: Romantic comedy

epilogues:
- path: /movies
method: DELETE
status: [200, 404]
chapters:
- synopsis: Create a document.
path: /{index}/_doc
method: POST
parameters:
index: movies
request_body:
payload:
genre: Romantic comedy
year: 1991
response:
status: 201

0 comments on commit 96cf20d

Please sign in to comment.