Skip to content

Commit c6fbaf9

Browse files
authored
Fixed /_mapping with index in query (#385)
Signed-off-by: dblock <[email protected]>
1 parent 667091c commit c6fbaf9

File tree

3 files changed

+68
-0
lines changed

3 files changed

+68
-0
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
7676
- Fixed `Metadata` schema ([#399](https://github.com/opensearch-project/opensearch-api-specification/pull/399))
7777
- Fixed `/_data_stream` health status and required fields ([#401](https://github.com/opensearch-project/opensearch-api-specification/pull/401))
7878
- Fixed query DSL `match` that supports a field name and value ([#405](https://github.com/opensearch-project/opensearch-api-specification/pull/405))
79+
- Fixed `/_mapping` with `index` in query ([#385](https://github.com/opensearch-project/opensearch-api-specification/pull/385))
7980

8081
### Security
8182

spec/namespaces/indices.yaml

+13
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,7 @@ paths:
418418
- $ref: '#/components/parameters/indices.get_mapping::query.cluster_manager_timeout'
419419
- $ref: '#/components/parameters/indices.get_mapping::query.expand_wildcards'
420420
- $ref: '#/components/parameters/indices.get_mapping::query.ignore_unavailable'
421+
- $ref: '#/components/parameters/indices.get_mapping::query.index'
421422
- $ref: '#/components/parameters/indices.get_mapping::query.local'
422423
- $ref: '#/components/parameters/indices.get_mapping::query.master_timeout'
423424
responses:
@@ -1302,6 +1303,7 @@ paths:
13021303
- $ref: '#/components/parameters/indices.get_mapping::query.cluster_manager_timeout'
13031304
- $ref: '#/components/parameters/indices.get_mapping::query.expand_wildcards'
13041305
- $ref: '#/components/parameters/indices.get_mapping::query.ignore_unavailable'
1306+
- $ref: '#/components/parameters/indices.get_mapping::query.index'
13051307
- $ref: '#/components/parameters/indices.get_mapping::query.local'
13061308
- $ref: '#/components/parameters/indices.get_mapping::query.master_timeout'
13071309
responses:
@@ -3828,6 +3830,17 @@ components:
38283830
schema:
38293831
type: boolean
38303832
style: form
3833+
indices.get_mapping::query.index:
3834+
in: query
3835+
name: index
3836+
description: |-
3837+
Comma-separated list of data streams, indices, and aliases used to limit the request.
3838+
Supports wildcards (`*`).
3839+
To target all data streams and indices, omit this parameter or use `*` or `_all`.
3840+
required: true
3841+
schema:
3842+
$ref: '../schemas/_common.yaml#/components/schemas/Indices'
3843+
style: simple
38313844
indices.get_mapping::query.local:
38323845
in: query
38333846
name: local

tests/_core/mapping.yaml

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
$schema: ../../json_schemas/test_story.schema.yaml
2+
3+
description: Test mappings endpoints.
4+
prologues:
5+
- path: /{index}
6+
method: PUT
7+
parameters:
8+
index: movies
9+
request_body:
10+
payload:
11+
mappings:
12+
properties:
13+
director:
14+
type: text
15+
year:
16+
type: integer
17+
location:
18+
type: ip
19+
ignore_malformed: true
20+
epilogues:
21+
- path: /movies
22+
method: DELETE
23+
status: [200, 404]
24+
chapters:
25+
- synopsis: Get mappings for an index (index in query).
26+
path: /_mapping
27+
method: GET
28+
parameters:
29+
index: movies
30+
response:
31+
status: 200
32+
payload:
33+
movies:
34+
mappings:
35+
properties:
36+
director:
37+
type: text
38+
year:
39+
type: integer
40+
- synopsis: Get mappings for an index (index in path).
41+
path: /{index}/_mapping
42+
method: GET
43+
parameters:
44+
index: movies
45+
response:
46+
status: 200
47+
payload:
48+
movies:
49+
mappings:
50+
properties:
51+
director:
52+
type: text
53+
year:
54+
type: integer

0 commit comments

Comments
 (0)