Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix core schemas #777

Merged
merged 2 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Added `aggregations` to `/nodes/_usage/{metric}` requests and responses ([#615](https://github.com/opensearch-project/opensearch-api-specification/pull/615))
- Added missing `status` to `/_search/template` response ([#702](https://github.com/opensearch-project/opensearch-api-specification/pull/702))
- Added `_type` to `rank_eval` API specs ([#704](https://github.com/opensearch-project/opensearch-api-specification/pull/704))
- Added request body to `_search_shards` API specs ([#709](https://github.com/opensearch-project/opensearch-api-specification/pull/709))
- Added NodeAttributes as additional property in `shard_stores` API specs ([#715](https://github.com/opensearch-project/opensearch-api-specification/pull/715))
- Added missing `repository` query parameter to `/_cat/snapshots` ([#700](https://github.com/opensearch-project/opensearch-api-specification/pull/700))
- Added `sm` namespace API specifications ([#701](https://github.com/opensearch-project/opensearch-api-specification/pull/701))
Expand Down Expand Up @@ -96,6 +95,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Fixed nodes API schemas ([#761](https://github.com/opensearch-project/opensearch-api-specification/pull/761))
- Fixed ingest API schemas ([#766](https://github.com/opensearch-project/opensearch-api-specification/pull/766))
- Fixed CAT API schemas ([#769](https://github.com/opensearch-project/opensearch-api-specification/pull/769))
- Fixed core API schemas ([#777](https://github.com/opensearch-project/opensearch-api-specification/pull/777))

### Changed
- 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))
Expand Down
78 changes: 14 additions & 64 deletions spec/namespaces/_core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@ paths:
- $ref: '#/components/parameters/reindex::query.max_docs'
- $ref: '#/components/parameters/reindex::query.refresh'
- $ref: '#/components/parameters/reindex::query.requests_per_second'
- $ref: '#/components/parameters/reindex::query.require_alias'
- $ref: '#/components/parameters/reindex::query.scroll'
- $ref: '#/components/parameters/reindex::query.slices'
- $ref: '#/components/parameters/reindex::query.timeout'
Expand Down Expand Up @@ -1028,8 +1029,6 @@ paths:
- $ref: '#/components/parameters/search_shards::query.local'
- $ref: '#/components/parameters/search_shards::query.preference'
- $ref: '#/components/parameters/search_shards::query.routing'
requestBody:
$ref: '#/components/requestBodies/search_shards'
responses:
'200':
$ref: '#/components/responses/search_shards@200'
Expand All @@ -1047,8 +1046,6 @@ paths:
- $ref: '#/components/parameters/search_shards::query.local'
- $ref: '#/components/parameters/search_shards::query.preference'
- $ref: '#/components/parameters/search_shards::query.routing'
requestBody:
$ref: '#/components/requestBodies/search_shards'
responses:
'200':
$ref: '#/components/responses/search_shards@200'
Expand Down Expand Up @@ -2011,8 +2008,6 @@ paths:
- $ref: '#/components/parameters/search_shards::query.local'
- $ref: '#/components/parameters/search_shards::query.preference'
- $ref: '#/components/parameters/search_shards::query.routing'
requestBody:
$ref: '#/components/requestBodies/search_shards'
responses:
'200':
$ref: '#/components/responses/search_shards@200'
Expand All @@ -2031,8 +2026,6 @@ paths:
- $ref: '#/components/parameters/search_shards::query.local'
- $ref: '#/components/parameters/search_shards::query.preference'
- $ref: '#/components/parameters/search_shards::query.routing'
requestBody:
$ref: '#/components/requestBodies/search_shards'
responses:
'200':
$ref: '#/components/responses/search_shards@200'
Expand Down Expand Up @@ -2703,46 +2696,6 @@ components:
type: string
description: The search definition template and its parameters.
required: true
search_shards:
content:
application/json:
schema:
type: object
properties:
query:
description: Defines the search query to filter shards. Supports any query that is valid for the `_search` endpoint.
type: object
additionalProperties:
type: object
indices_boost:
description: Allows increasing the relevance of specific indexes in the search.
type: object
additionalProperties:
type: number
allow_partial_search_results:
description: Indicates whether partial search results are allowed if some shards are unavailable.
type: boolean
_source:
description: Specifies which fields to include in the `_source` response or excludes specific fields.
oneOf:
- type: boolean
- type: array
items:
type: string
from:
description: The starting offset (default 0) for paginated results.
type: integer
size:
description: The maximum number of results to return (default 10).
type: integer
sort:
description: A list of fields and directions for sorting the results.
type: array
items:
type: object
additionalProperties:
type: string
description: Defines the parameters that can be used in the `search_shards` endpoint request. See documentation for supported query syntax.
termvectors:
content:
application/json:
Expand Down Expand Up @@ -2921,7 +2874,7 @@ components:
pit_id:
type: string
_shards:
$ref: '../schemas/_core._common.yaml#/components/schemas/ShardStatistics'
$ref: '../schemas/_common.yaml#/components/schemas/ShardStatistics'
creation_time:
type: integer
format: int64
Expand All @@ -2944,7 +2897,7 @@ components:
pits:
type: array
items:
$ref: '../schemas/_core._common.yaml#/components/schemas/PitsDetailsDeleteAll'
$ref: '../schemas/_core.pit.yaml#/components/schemas/DeletedPit'
delete_by_query@200:
content:
application/json:
Expand All @@ -2969,7 +2922,7 @@ components:
pits:
type: array
items:
$ref: '../schemas/_core._common.yaml#/components/schemas/DeletedPit'
$ref: '../schemas/_core.pit.yaml#/components/schemas/DeletedPit'
delete_script@200:
content:
application/json:
Expand Down Expand Up @@ -3045,7 +2998,7 @@ components:
pits:
type: array
items:
$ref: '../schemas/_core._common.yaml#/components/schemas/PitDetail'
$ref: '../schemas/_core.pit.yaml#/components/schemas/PitDetail'
get_script@200:
content:
application/json:
Expand Down Expand Up @@ -3191,8 +3144,7 @@ components:
$ref: '../schemas/_core.rank_eval.yaml#/components/schemas/RankEvalMetricDetail'
failures:
type: object
additionalProperties:
type: object
additionalProperties: true
required:
- details
- failures
Expand Down Expand Up @@ -3227,8 +3179,7 @@ components:
properties:
template_output:
type: object
additionalProperties:
type: object
additionalProperties: true
required:
- template_output
scripts_painless_execute@200:
Expand Down Expand Up @@ -3953,10 +3904,7 @@ components:
description: Set to `true` or `false` to return the `_source` field or not, or a list of fields to return.
style: form
schema:
type: array
items:
type: string
description: Set to `true` or `false` to return the `_source` field or not, or a list of fields to return.
$ref: '../schemas/_core.search.yaml#/components/schemas/SourceConfigParam'
explode: true
delete_by_query::query._source_excludes:
name: _source_excludes
Expand Down Expand Up @@ -5341,6 +5289,11 @@ components:
format: float
default: 0
style: form
reindex::query.require_alias:
in: query
name: require_alias
schema:
type: boolean
reindex::query.scroll:
in: query
name: scroll
Expand Down Expand Up @@ -6295,10 +6248,7 @@ components:
description: Set to `true` or `false` to return the `_source` field or not, or a list of fields to return.
style: form
schema:
type: array
items:
type: string
description: Set to `true` or `false` to return the `_source` field or not, or a list of fields to return.
$ref: '../schemas/_core.search.yaml#/components/schemas/SourceConfigParam'
explode: true
update_by_query::query._source_excludes:
name: _source_excludes
Expand Down
33 changes: 16 additions & 17 deletions spec/schemas/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -444,10 +444,13 @@ components:
VersionString:
type: string
SearchType:
type: string
enum:
- dfs_query_then_fetch
- query_then_fetch
oneOf:
- type: string
const: dfs_query_then_fetch
description: Documents are scored using global term and document frequencies across all shards. This is usually slower but more accurate.
- type: string
const: query_then_fetch
description: Documents are scored using local term and document frequencies for the shard. This is usually faster but less accurate.
SuggestMode:
type: string
enum:
Expand Down Expand Up @@ -752,7 +755,8 @@ components:
field:
$ref: '#/components/schemas/Field'
id:
$ref: '#/components/schemas/Id'
type: integer
format: int32
max:
type: integer
format: int32
Expand Down Expand Up @@ -1573,8 +1577,11 @@ components:
Slices:
description: The slice configuration used to parallelize a process.
oneOf:
- type: number
- $ref: '#/components/schemas/SlicesCalculation'
- title: count
type: integer
format: int32
- title: calculation
$ref: '#/components/schemas/SlicesCalculation'
SlicesCalculation:
type: string
enum:
Expand Down Expand Up @@ -2218,7 +2225,8 @@ components:
node:
$ref: '#/components/schemas/NodeName'
shard:
type: number
type: integer
format: int32
index:
$ref: '#/components/schemas/IndexName'
allocation_id:
Expand All @@ -2235,20 +2243,11 @@ components:
oneOf:
- $ref: '#/components/schemas/NodeId'
- type: 'null'
relocation_failure_info:
$ref: '#/components/schemas/RelocationFailureInfo'
required:
- index
- primary
- shard
- state
RelocationFailureInfo:
type: object
properties:
failed_attempts:
type: number
required:
- failed_attempts
OpenSearchVersionInfo:
type: object
properties:
Expand Down
48 changes: 0 additions & 48 deletions spec/schemas/_core._common.yaml

This file was deleted.

6 changes: 5 additions & 1 deletion spec/schemas/_core.field_caps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ components:
indices:
$ref: '_common.yaml#/components/schemas/Indices'
meta:
$ref: '_common.yaml#/components/schemas/Metadata'
type: object
additionalProperties:
type: array
items:
type: string
non_aggregatable_indices:
$ref: '_common.yaml#/components/schemas/Indices'
non_searchable_indices:
Expand Down
4 changes: 2 additions & 2 deletions spec/schemas/_core.mtermvectors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ components:
$ref: '_common.yaml#/components/schemas/IndexName'
doc:
description: An artificial document for which you want to retrieve term vectors.
type: object
fields:
$ref: '_common.yaml#/components/schemas/Fields'
field_statistics:
Expand Down Expand Up @@ -53,7 +52,8 @@ components:
_version:
$ref: '_common.yaml#/components/schemas/VersionNumber'
took:
type: number
type: integer
format: int64
found:
type: boolean
term_vectors:
Expand Down
26 changes: 26 additions & 0 deletions spec/schemas/_core.pit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
openapi: 3.1.0
info:
title: Schemas of `_core.pit` Category
description: Schemas of `_core.pit` category.
version: 1.0.0
paths: {}
components:
schemas:
DeletedPit:
type: object
properties:
successful:
type: boolean
pit_id:
type: string
PitDetail:
type: object
properties:
pit_id:
type: string
creation_time:
type: integer
format: int64
keep_alive:
type: integer
format: int64
Loading
Loading