Skip to content

Commit

Permalink
Test index mappings.
Browse files Browse the repository at this point in the history
  • Loading branch information
dblock committed Jul 8, 2024
1 parent 370dab3 commit 21b45a1
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 2 deletions.
11 changes: 11 additions & 0 deletions spec/namespaces/indices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ paths:
externalDocs:
url: https://opensearch.org/docs/latest/field-types/index/#get-a-mapping
parameters:
- $ref: '#/components/parameters/indices.get_mapping::query.index'
- $ref: '#/components/parameters/indices.get_mapping::query.allow_no_indices'
- $ref: '#/components/parameters/indices.get_mapping::query.cluster_manager_timeout'
- $ref: '#/components/parameters/indices.get_mapping::query.expand_wildcards'
Expand Down Expand Up @@ -3780,6 +3781,16 @@ components:
schema:
$ref: '../schemas/_common.yaml#/components/schemas/Indices'
style: simple
indices.get_mapping::query.index:
in: query
name: index
description: |-
Comma-separated list of data streams, indices, and aliases used to limit
the request. Supports wildcards (`*`). To target all data streams and
indices, omit this parameter or use `*` or `_all`.
schema:
type: string
style: form
indices.get_mapping::query.allow_no_indices:
in: query
name: allow_no_indices
Expand Down
5 changes: 3 additions & 2 deletions spec/schemas/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ components:
type: string
Metadata:
type: object
additionalProperties:
type: object
properties:
version:
$ref: '#/components/schemas/VersionNumber'
GeoBounds:
description: |-
A geo bounding box. It can be represented in various ways:
Expand Down
39 changes: 39 additions & 0 deletions tests/_core/mapping.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
$schema: ../../json_schemas/test_story.schema.yaml

description: Test mappings endpoints.
prologues:
- path: /{index}
method: PUT
parameters:
index: movies
request_body:
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.
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 21b45a1

Please sign in to comment.