Skip to content

Commit

Permalink
Added FlatObjectProperty. (#661)
Browse files Browse the repository at this point in the history
Signed-off-by: dblock <[email protected]>
  • Loading branch information
dblock authored Nov 12, 2024
1 parent 0d5f712 commit 9aa52da
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 46 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
16 changes: 16 additions & 0 deletions spec/schemas/_common.mapping.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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'
Expand Down
47 changes: 1 addition & 46 deletions tests/default/_core/mapping.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 9aa52da

Please sign in to comment.