diff --git a/spec/schemas/_common.mapping.yaml b/spec/schemas/_common.mapping.yaml index 18ef5472f..20bcf3178 100644 --- a/spec/schemas/_common.mapping.yaml +++ b/spec/schemas/_common.mapping.yaml @@ -796,6 +796,7 @@ components: - constant_keyword required: - type + - value FieldAliasProperty: allOf: - $ref: '#/components/schemas/PropertyBase' diff --git a/tests/indices/constant_keyword.yaml b/tests/indices/constant_keyword.yaml new file mode 100644 index 000000000..c5125f411 --- /dev/null +++ b/tests/indices/constant_keyword.yaml @@ -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