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

Fixed nodes API schemas #761

Merged
merged 3 commits into from
Jan 3, 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Fixed indices API schemas ([#750](https://github.com/opensearch-project/opensearch-api-specification/pull/750))
- Fixed cluster API schemas ([#754](https://github.com/opensearch-project/opensearch-api-specification/pull/754))
- Fixed schema validation for invalid properties in `retry` configuration ([#758](https://github.com/opensearch-project/opensearch-api-specification/pull/758))
- Fixed nodes API schemas ([#761](https://github.com/opensearch-project/opensearch-api-specification/pull/761))

### 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
6 changes: 1 addition & 5 deletions spec/_global_parameters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,4 @@ components:
in: query
description: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-".
schema:
oneOf:
- type: string
- type: array
items:
type: string
$ref: 'schemas/_common.yaml#/components/schemas/StringOrStringArray'
6 changes: 1 addition & 5 deletions spec/namespaces/_core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5755,11 +5755,7 @@ components:
name: sort
description: A comma-separated list of <field>:<direction> pairs.
schema:
oneOf:
- type: string
- type: array
items:
type: string
$ref: '../schemas/_common.yaml#/components/schemas/StringOrStringArray'
style: form
search::query.stats:
in: query
Expand Down
12 changes: 2 additions & 10 deletions spec/namespaces/indices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2128,11 +2128,7 @@ components:
description: |-
Array of wildcard expressions used to match the names
of indexes during creation.
oneOf:
- type: string
- type: array
items:
type: string
$ref: '../schemas/_common.yaml#/components/schemas/StringOrStringArray'
mappings:
$ref: '../schemas/_common.mapping.yaml#/components/schemas/TypeMapping'
order:
Expand Down Expand Up @@ -5083,11 +5079,7 @@ components:
name: groups
description: Comma-separated list of search groups to include in the search statistics.
schema:
oneOf:
- type: string
- type: array
items:
type: string
$ref: '../schemas/_common.yaml#/components/schemas/StringOrStringArray'
style: form
indices.stats::query.include_segment_file_sizes:
in: query
Expand Down
55 changes: 51 additions & 4 deletions spec/namespaces/nodes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -366,22 +366,69 @@ components:
content:
application/json:
schema:
$ref: '../schemas/nodes.info.yaml#/components/schemas/ResponseBase'
allOf:
- $ref: '../schemas/nodes._common.yaml#/components/schemas/NodesResponseBase'
- type: object
properties:
cluster_name:
$ref: '../schemas/_common.yaml#/components/schemas/Name'
nodes:
type: object
additionalProperties:
$ref: '../schemas/nodes.info.yaml#/components/schemas/NodeInfo'
required:
- cluster_name
- nodes
nodes.reload_secure_settings@200:
content:
application/json:
schema:
$ref: '../schemas/nodes.reload_secure_settings.yaml#/components/schemas/ResponseBase'
allOf:
- $ref: '../schemas/nodes._common.yaml#/components/schemas/NodesResponseBase'
- type: object
properties:
cluster_name:
$ref: '../schemas/_common.yaml#/components/schemas/Name'
nodes:
type: object
additionalProperties:
$ref: '../schemas/nodes.reload_secure_settings.yaml#/components/schemas/NodeReloadResult'
required:
- cluster_name
- nodes
nodes.stats@200:
content:
application/json:
schema:
$ref: '../schemas/nodes.stats.yaml#/components/schemas/ResponseBase'
allOf:
- $ref: '../schemas/nodes._common.yaml#/components/schemas/NodesResponseBase'
- type: object
properties:
cluster_name:
$ref: '../schemas/_common.yaml#/components/schemas/Name'
nodes:
type: object
additionalProperties:
$ref: '../schemas/nodes.stats.yaml#/components/schemas/Stats'
required:
- nodes
nodes.usage@200:
content:
application/json:
schema:
$ref: '../schemas/nodes.usage.yaml#/components/schemas/ResponseBase'
allOf:
- $ref: '../schemas/nodes._common.yaml#/components/schemas/NodesResponseBase'
- type: object
properties:
cluster_name:
$ref: '../schemas/_common.yaml#/components/schemas/Name'
nodes:
type: object
additionalProperties:
$ref: '../schemas/nodes.usage.yaml#/components/schemas/NodeUsage'
required:
- cluster_name
- nodes
parameters:
nodes.hot_threads::path.node_id:
name: node_id
Expand Down
12 changes: 2 additions & 10 deletions spec/namespaces/tasks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,7 @@ components:
name: actions
description: Comma-separated list or wildcard expression of actions used to limit the request.
schema:
oneOf:
- type: string
- type: array
items:
type: string
$ref: '../schemas/_common.yaml#/components/schemas/StringOrStringArray'
style: form
tasks.cancel::query.nodes:
in: query
Expand Down Expand Up @@ -175,11 +171,7 @@ components:
name: actions
description: Comma-separated list or wildcard expression of actions used to limit the request.
schema:
oneOf:
- type: string
- type: array
items:
type: string
$ref: '../schemas/_common.yaml#/components/schemas/StringOrStringArray'
style: form
tasks.list::query.detailed:
in: query
Expand Down
6 changes: 1 addition & 5 deletions spec/schemas/_common.analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,7 @@ components:
Language value, such as `arabic` or `thai`. Defaults to `english`.
Each language value corresponds to a predefined list of stop words in Lucene. See Stop words by language for supported language values and their stop words.
Also accepts an array of stop words.
oneOf:
- type: string
- type: array
items:
type: string
$ref: '_common.yaml#/components/schemas/StringOrStringArray'
KeywordAnalyzer:
type: object
properties:
Expand Down
25 changes: 15 additions & 10 deletions spec/schemas/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -385,16 +385,19 @@ components:
description: Time unit for nanoseconds.
type: integer
format: int64
DurationValueUnitMicros:
allOf:
- $ref: '#/components/schemas/UnitMicros'
UnitMicros:
description: Time unit for microseconds.
type: integer
format: int64
ScrollId:
type: string
Routing:
type: string
RoutingInQueryString:
oneOf:
- type: string
- type: array
items:
type: string
$ref: '#/components/schemas/StringOrStringArray'
DateTime:
description: |-
A date and time, either as a string whose format depends on the context (defaulting to ISO_8601) or the
Expand Down Expand Up @@ -925,6 +928,12 @@ components:
$ref: '#/components/schemas/ScrollId'
TransportAddress:
type: string
StringOrStringArray:
oneOf:
- type: string
- type: array
items:
type: string
StringifiedInteger:
description: |-
Certain APIs may return values, including numbers such as epoch timestamps, as strings. This setting captures
Expand Down Expand Up @@ -2143,11 +2152,7 @@ components:
HttpHeaders:
type: object
additionalProperties:
oneOf:
- type: string
- type: array
items:
type: string
$ref: '#/components/schemas/StringOrStringArray'
Password:
type: string
Username:
Expand Down
6 changes: 1 addition & 5 deletions spec/schemas/indices._common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ components:
mode:
type: string
routing_path:
oneOf:
- type: string
- type: array
items:
type: string
$ref: '_common.yaml#/components/schemas/StringOrStringArray'
soft_deletes:
$ref: '#/components/schemas/SoftDeletes'
soft_deletes.retention_lease.period:
Expand Down
6 changes: 1 addition & 5 deletions spec/schemas/indices.analyze.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ paths: {}
components:
schemas:
TextToAnalyze:
oneOf:
- type: string
- type: array
items:
type: string
$ref: '_common.yaml#/components/schemas/StringOrStringArray'
AnalyzeDetail:
type: object
properties:
Expand Down
7 changes: 6 additions & 1 deletion spec/schemas/indices.stats.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ components:
allOf:
- $ref: '#/components/schemas/IndexStatsBase'
- type: object
IndexShardStats:
IndexShardStatsBase:
allOf:
- $ref: '#/components/schemas/IndexStatsBase'
- type: object
Expand All @@ -110,6 +110,11 @@ components:
$ref: '#/components/schemas/ShardRetentionLeases'
shard_path:
$ref: '#/components/schemas/ShardPath'
IndexShardStats:
allOf:
- $ref: '#/components/schemas/IndexShardStatsBase'
- type: object
properties: {}
Metric:
type: string
enum:
Expand Down
Loading
Loading