From 9aa52da61ea021baa2ed148043477b9f83462b74 Mon Sep 17 00:00:00 2001 From: "Daniel (dB.) Doubrovkine" Date: Mon, 11 Nov 2024 23:09:37 -0500 Subject: [PATCH] Added FlatObjectProperty. (#661) Signed-off-by: dblock --- CHANGELOG.md | 1 + spec/schemas/_common.mapping.yaml | 16 +++++++++++ tests/default/_core/mapping.yaml | 47 +------------------------------ 3 files changed, 18 insertions(+), 46 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e455a6d4f..47df345f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Added Python and Ruby spec validators ([#646](https://github.com/opensearch-project/opensearch-api-specification/pull/646)) - Added verbose output of the story being evaluated ([#646](https://github.com/opensearch-project/opensearch-api-specification/pull/646)) - Added `_search` with `sort: direction` ([#658](https://github.com/opensearch-project/opensearch-api-specification/pull/658)) +- Added `_common.mapping:FlatObjectProperty` ([#661](https://github.com/opensearch-project/opensearch-api-specification/pull/661)) ### Removed - Removed unsupported `_common.mapping:SourceField`'s `mode` field and associated `_common.mapping:SourceFieldMode` enum ([#652](https://github.com/opensearch-project/opensearch-api-specification/pull/652)) diff --git a/spec/schemas/_common.mapping.yaml b/spec/schemas/_common.mapping.yaml index 6523b2143..9e2bc2c5f 100644 --- a/spec/schemas/_common.mapping.yaml +++ b/spec/schemas/_common.mapping.yaml @@ -128,6 +128,7 @@ components: - $ref: '#/components/schemas/DenseVectorProperty' - $ref: '#/components/schemas/SparseVectorProperty' - $ref: '#/components/schemas/FlattenedProperty' + - $ref: '#/components/schemas/FlatObjectProperty' - $ref: '#/components/schemas/NestedProperty' - $ref: '#/components/schemas/ObjectProperty' - $ref: '#/components/schemas/CompletionProperty' @@ -614,6 +615,21 @@ components: - flattened required: - type + FlatObjectProperty: + allOf: + - $ref: '#/components/schemas/PropertyBase' + - type: object + properties: + searchable: + type: boolean + aggregatable: + type: boolean + type: + type: string + enum: + - flat_object + required: + - type NestedProperty: allOf: - $ref: '#/components/schemas/CorePropertyBase' diff --git a/tests/default/_core/mapping.yaml b/tests/default/_core/mapping.yaml index 29c2c335d..586e3a569 100644 --- a/tests/default/_core/mapping.yaml +++ b/tests/default/_core/mapping.yaml @@ -1,54 +1,9 @@ $schema: ../../../json_schemas/test_story.schema.yaml description: Test mappings endpoints. -prologues: - - path: /{index} - method: PUT - parameters: - index: movies - request: - payload: - mappings: - properties: - director: - type: text - year: - type: integer - location: - type: ip - ignore_malformed: true -epilogues: - - path: /movies - method: DELETE - status: [200, 404] chapters: - - synopsis: Get mappings for an index (index in query). + - synopsis: Get all mappings. path: /_mapping method: GET - parameters: - index: movies response: status: 200 - payload: - movies: - mappings: - properties: - director: - type: text - year: - type: integer - - synopsis: Get mappings for an index (index in path). - path: /{index}/_mapping - method: GET - parameters: - index: movies - response: - status: 200 - payload: - movies: - mappings: - properties: - director: - type: text - year: - type: integer \ No newline at end of file