Skip to content

Commit 5177c0a

Browse files
authored
Fix core schemas (#777)
* Fix core schemas Signed-off-by: Thomas Farr <[email protected]> * Remove unsupported search shards test Signed-off-by: Thomas Farr <[email protected]> --------- Signed-off-by: Thomas Farr <[email protected]>
1 parent c1651ec commit 5177c0a

14 files changed

+136
-195
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
2323
- Added `aggregations` to `/nodes/_usage/{metric}` requests and responses ([#615](https://github.com/opensearch-project/opensearch-api-specification/pull/615))
2424
- Added missing `status` to `/_search/template` response ([#702](https://github.com/opensearch-project/opensearch-api-specification/pull/702))
2525
- Added `_type` to `rank_eval` API specs ([#704](https://github.com/opensearch-project/opensearch-api-specification/pull/704))
26-
- Added request body to `_search_shards` API specs ([#709](https://github.com/opensearch-project/opensearch-api-specification/pull/709))
2726
- Added NodeAttributes as additional property in `shard_stores` API specs ([#715](https://github.com/opensearch-project/opensearch-api-specification/pull/715))
2827
- Added missing `repository` query parameter to `/_cat/snapshots` ([#700](https://github.com/opensearch-project/opensearch-api-specification/pull/700))
2928
- Added `sm` namespace API specifications ([#701](https://github.com/opensearch-project/opensearch-api-specification/pull/701))
@@ -96,6 +95,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
9695
- Fixed nodes API schemas ([#761](https://github.com/opensearch-project/opensearch-api-specification/pull/761))
9796
- Fixed ingest API schemas ([#766](https://github.com/opensearch-project/opensearch-api-specification/pull/766))
9897
- Fixed CAT API schemas ([#769](https://github.com/opensearch-project/opensearch-api-specification/pull/769))
98+
- Fixed core API schemas ([#777](https://github.com/opensearch-project/opensearch-api-specification/pull/777))
9999

100100
### Changed
101101
- Changed `tasks._common:TaskInfo` and `tasks._common:TaskGroup` to be composed of a `tasks._common:TaskInfoBase` ([#683](https://github.com/opensearch-project/opensearch-api-specification/pull/683))

spec/namespaces/_core.yaml

+14-64
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,7 @@ paths:
455455
- $ref: '#/components/parameters/reindex::query.max_docs'
456456
- $ref: '#/components/parameters/reindex::query.refresh'
457457
- $ref: '#/components/parameters/reindex::query.requests_per_second'
458+
- $ref: '#/components/parameters/reindex::query.require_alias'
458459
- $ref: '#/components/parameters/reindex::query.scroll'
459460
- $ref: '#/components/parameters/reindex::query.slices'
460461
- $ref: '#/components/parameters/reindex::query.timeout'
@@ -1028,8 +1029,6 @@ paths:
10281029
- $ref: '#/components/parameters/search_shards::query.local'
10291030
- $ref: '#/components/parameters/search_shards::query.preference'
10301031
- $ref: '#/components/parameters/search_shards::query.routing'
1031-
requestBody:
1032-
$ref: '#/components/requestBodies/search_shards'
10331032
responses:
10341033
'200':
10351034
$ref: '#/components/responses/search_shards@200'
@@ -1047,8 +1046,6 @@ paths:
10471046
- $ref: '#/components/parameters/search_shards::query.local'
10481047
- $ref: '#/components/parameters/search_shards::query.preference'
10491048
- $ref: '#/components/parameters/search_shards::query.routing'
1050-
requestBody:
1051-
$ref: '#/components/requestBodies/search_shards'
10521049
responses:
10531050
'200':
10541051
$ref: '#/components/responses/search_shards@200'
@@ -2011,8 +2008,6 @@ paths:
20112008
- $ref: '#/components/parameters/search_shards::query.local'
20122009
- $ref: '#/components/parameters/search_shards::query.preference'
20132010
- $ref: '#/components/parameters/search_shards::query.routing'
2014-
requestBody:
2015-
$ref: '#/components/requestBodies/search_shards'
20162011
responses:
20172012
'200':
20182013
$ref: '#/components/responses/search_shards@200'
@@ -2031,8 +2026,6 @@ paths:
20312026
- $ref: '#/components/parameters/search_shards::query.local'
20322027
- $ref: '#/components/parameters/search_shards::query.preference'
20332028
- $ref: '#/components/parameters/search_shards::query.routing'
2034-
requestBody:
2035-
$ref: '#/components/requestBodies/search_shards'
20362029
responses:
20372030
'200':
20382031
$ref: '#/components/responses/search_shards@200'
@@ -2703,46 +2696,6 @@ components:
27032696
type: string
27042697
description: The search definition template and its parameters.
27052698
required: true
2706-
search_shards:
2707-
content:
2708-
application/json:
2709-
schema:
2710-
type: object
2711-
properties:
2712-
query:
2713-
description: Defines the search query to filter shards. Supports any query that is valid for the `_search` endpoint.
2714-
type: object
2715-
additionalProperties:
2716-
type: object
2717-
indices_boost:
2718-
description: Allows increasing the relevance of specific indexes in the search.
2719-
type: object
2720-
additionalProperties:
2721-
type: number
2722-
allow_partial_search_results:
2723-
description: Indicates whether partial search results are allowed if some shards are unavailable.
2724-
type: boolean
2725-
_source:
2726-
description: Specifies which fields to include in the `_source` response or excludes specific fields.
2727-
oneOf:
2728-
- type: boolean
2729-
- type: array
2730-
items:
2731-
type: string
2732-
from:
2733-
description: The starting offset (default 0) for paginated results.
2734-
type: integer
2735-
size:
2736-
description: The maximum number of results to return (default 10).
2737-
type: integer
2738-
sort:
2739-
description: A list of fields and directions for sorting the results.
2740-
type: array
2741-
items:
2742-
type: object
2743-
additionalProperties:
2744-
type: string
2745-
description: Defines the parameters that can be used in the `search_shards` endpoint request. See documentation for supported query syntax.
27462699
termvectors:
27472700
content:
27482701
application/json:
@@ -2921,7 +2874,7 @@ components:
29212874
pit_id:
29222875
type: string
29232876
_shards:
2924-
$ref: '../schemas/_core._common.yaml#/components/schemas/ShardStatistics'
2877+
$ref: '../schemas/_common.yaml#/components/schemas/ShardStatistics'
29252878
creation_time:
29262879
type: integer
29272880
format: int64
@@ -2944,7 +2897,7 @@ components:
29442897
pits:
29452898
type: array
29462899
items:
2947-
$ref: '../schemas/_core._common.yaml#/components/schemas/PitsDetailsDeleteAll'
2900+
$ref: '../schemas/_core.pit.yaml#/components/schemas/DeletedPit'
29482901
delete_by_query@200:
29492902
content:
29502903
application/json:
@@ -2969,7 +2922,7 @@ components:
29692922
pits:
29702923
type: array
29712924
items:
2972-
$ref: '../schemas/_core._common.yaml#/components/schemas/DeletedPit'
2925+
$ref: '../schemas/_core.pit.yaml#/components/schemas/DeletedPit'
29732926
delete_script@200:
29742927
content:
29752928
application/json:
@@ -3045,7 +2998,7 @@ components:
30452998
pits:
30462999
type: array
30473000
items:
3048-
$ref: '../schemas/_core._common.yaml#/components/schemas/PitDetail'
3001+
$ref: '../schemas/_core.pit.yaml#/components/schemas/PitDetail'
30493002
get_script@200:
30503003
content:
30513004
application/json:
@@ -3191,8 +3144,7 @@ components:
31913144
$ref: '../schemas/_core.rank_eval.yaml#/components/schemas/RankEvalMetricDetail'
31923145
failures:
31933146
type: object
3194-
additionalProperties:
3195-
type: object
3147+
additionalProperties: true
31963148
required:
31973149
- details
31983150
- failures
@@ -3227,8 +3179,7 @@ components:
32273179
properties:
32283180
template_output:
32293181
type: object
3230-
additionalProperties:
3231-
type: object
3182+
additionalProperties: true
32323183
required:
32333184
- template_output
32343185
scripts_painless_execute@200:
@@ -3953,10 +3904,7 @@ components:
39533904
description: Set to `true` or `false` to return the `_source` field or not, or a list of fields to return.
39543905
style: form
39553906
schema:
3956-
type: array
3957-
items:
3958-
type: string
3959-
description: Set to `true` or `false` to return the `_source` field or not, or a list of fields to return.
3907+
$ref: '../schemas/_core.search.yaml#/components/schemas/SourceConfigParam'
39603908
explode: true
39613909
delete_by_query::query._source_excludes:
39623910
name: _source_excludes
@@ -5341,6 +5289,11 @@ components:
53415289
format: float
53425290
default: 0
53435291
style: form
5292+
reindex::query.require_alias:
5293+
in: query
5294+
name: require_alias
5295+
schema:
5296+
type: boolean
53445297
reindex::query.scroll:
53455298
in: query
53465299
name: scroll
@@ -6295,10 +6248,7 @@ components:
62956248
description: Set to `true` or `false` to return the `_source` field or not, or a list of fields to return.
62966249
style: form
62976250
schema:
6298-
type: array
6299-
items:
6300-
type: string
6301-
description: Set to `true` or `false` to return the `_source` field or not, or a list of fields to return.
6251+
$ref: '../schemas/_core.search.yaml#/components/schemas/SourceConfigParam'
63026252
explode: true
63036253
update_by_query::query._source_excludes:
63046254
name: _source_excludes

spec/schemas/_common.yaml

+16-17
Original file line numberDiff line numberDiff line change
@@ -444,10 +444,13 @@ components:
444444
VersionString:
445445
type: string
446446
SearchType:
447-
type: string
448-
enum:
449-
- dfs_query_then_fetch
450-
- query_then_fetch
447+
oneOf:
448+
- type: string
449+
const: dfs_query_then_fetch
450+
description: Documents are scored using global term and document frequencies across all shards. This is usually slower but more accurate.
451+
- type: string
452+
const: query_then_fetch
453+
description: Documents are scored using local term and document frequencies for the shard. This is usually faster but less accurate.
451454
SuggestMode:
452455
type: string
453456
enum:
@@ -752,7 +755,8 @@ components:
752755
field:
753756
$ref: '#/components/schemas/Field'
754757
id:
755-
$ref: '#/components/schemas/Id'
758+
type: integer
759+
format: int32
756760
max:
757761
type: integer
758762
format: int32
@@ -1573,8 +1577,11 @@ components:
15731577
Slices:
15741578
description: The slice configuration used to parallelize a process.
15751579
oneOf:
1576-
- type: number
1577-
- $ref: '#/components/schemas/SlicesCalculation'
1580+
- title: count
1581+
type: integer
1582+
format: int32
1583+
- title: calculation
1584+
$ref: '#/components/schemas/SlicesCalculation'
15781585
SlicesCalculation:
15791586
type: string
15801587
enum:
@@ -2218,7 +2225,8 @@ components:
22182225
node:
22192226
$ref: '#/components/schemas/NodeName'
22202227
shard:
2221-
type: number
2228+
type: integer
2229+
format: int32
22222230
index:
22232231
$ref: '#/components/schemas/IndexName'
22242232
allocation_id:
@@ -2235,20 +2243,11 @@ components:
22352243
oneOf:
22362244
- $ref: '#/components/schemas/NodeId'
22372245
- type: 'null'
2238-
relocation_failure_info:
2239-
$ref: '#/components/schemas/RelocationFailureInfo'
22402246
required:
22412247
- index
22422248
- primary
22432249
- shard
22442250
- state
2245-
RelocationFailureInfo:
2246-
type: object
2247-
properties:
2248-
failed_attempts:
2249-
type: number
2250-
required:
2251-
- failed_attempts
22522251
OpenSearchVersionInfo:
22532252
type: object
22542253
properties:

spec/schemas/_core._common.yaml

-48
This file was deleted.

spec/schemas/_core.field_caps.yaml

+5-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ components:
1515
indices:
1616
$ref: '_common.yaml#/components/schemas/Indices'
1717
meta:
18-
$ref: '_common.yaml#/components/schemas/Metadata'
18+
type: object
19+
additionalProperties:
20+
type: array
21+
items:
22+
type: string
1923
non_aggregatable_indices:
2024
$ref: '_common.yaml#/components/schemas/Indices'
2125
non_searchable_indices:

spec/schemas/_core.mtermvectors.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ components:
1515
$ref: '_common.yaml#/components/schemas/IndexName'
1616
doc:
1717
description: An artificial document for which you want to retrieve term vectors.
18-
type: object
1918
fields:
2019
$ref: '_common.yaml#/components/schemas/Fields'
2120
field_statistics:
@@ -53,7 +52,8 @@ components:
5352
_version:
5453
$ref: '_common.yaml#/components/schemas/VersionNumber'
5554
took:
56-
type: number
55+
type: integer
56+
format: int64
5757
found:
5858
type: boolean
5959
term_vectors:

spec/schemas/_core.pit.yaml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
openapi: 3.1.0
2+
info:
3+
title: Schemas of `_core.pit` Category
4+
description: Schemas of `_core.pit` category.
5+
version: 1.0.0
6+
paths: {}
7+
components:
8+
schemas:
9+
DeletedPit:
10+
type: object
11+
properties:
12+
successful:
13+
type: boolean
14+
pit_id:
15+
type: string
16+
PitDetail:
17+
type: object
18+
properties:
19+
pit_id:
20+
type: string
21+
creation_time:
22+
type: integer
23+
format: int64
24+
keep_alive:
25+
type: integer
26+
format: int64

0 commit comments

Comments
 (0)