Skip to content

Commit

Permalink
Fix routing param type and metric path params (#586)
Browse files Browse the repository at this point in the history
  • Loading branch information
Xtansia authored Sep 19, 2024
1 parent 3d49360 commit 2487252
Show file tree
Hide file tree
Showing 9 changed files with 71 additions and 21 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Added `/_plugins/_flow_framework/`, `_search`, `state/_search`, `_provision`, `_deprovision`, `_steps`, and `_status` ([#508](https://github.com/opensearch-project/opensearch-api-specification/issues/508)) ([#833](https://github.com/opensearch-project/flow-framework/issues/833))
- Added `/_plugins/_ism/policies`, `add`, `remove`, `change_policy`, `explain`, and `retry` ([#568](https://github.com/opensearch-project/opensearch-api-specification/pull/568)) ([#578](https://github.com/opensearch-project/opensearch-api-specification/pull/578))
- Added `/_plugins/refresh_search_analyzers` ([#578](https://github.com/opensearch-project/opensearch-api-specification/pull/578))
- Added the `context` query param to the `put_script` APIs ([#586](https://github.com/opensearch-project/opensearch-api-specification/pull/586))

### Changed

Expand All @@ -114,6 +115,10 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Rename `Bytes` component to `StorageType` ([#552](https://github.com/opensearch-project/opensearch-api-specification/pull/552))
- Rename `ByteSize` to `StorageSize` ([#552](https://github.com/opensearch-project/opensearch-api-specification/pull/552))
- Split `Percentage` into `PercentageNumber`, `PercentageString` ([#573](https://github.com/opensearch-project/opensearch-api-specification/pull/573))
- Unified all `routing` query params to take a string or array of strings ([#586](https://github.com/opensearch-project/opensearch-api-specification/pull/586))
- Changed `rank_eval`'s `search_type` query param to use the `SearchType` enum rather than a plain string ([#586](https://github.com/opensearch-project/opensearch-api-specification/pull/586))
- Changed `cluster.reroute`'s `metric` path param to use an enum of metrics ([#586](https://github.com/opensearch-project/opensearch-api-specification/pull/586))
- Changed `indices.stats`'s `metric` path param to use an enum of metrics ([#586](https://github.com/opensearch-project/opensearch-api-specification/pull/586))

### Deprecated

Expand Down
19 changes: 14 additions & 5 deletions spec/namespaces/_core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,7 @@ paths:
parameters:
- $ref: '#/components/parameters/put_script::path.id'
- $ref: '#/components/parameters/put_script::query.cluster_manager_timeout'
- $ref: '#/components/parameters/put_script::query.context'
- $ref: '#/components/parameters/put_script::query.master_timeout'
- $ref: '#/components/parameters/put_script::query.timeout'
requestBody:
Expand All @@ -577,6 +578,7 @@ paths:
parameters:
- $ref: '#/components/parameters/put_script::path.id'
- $ref: '#/components/parameters/put_script::query.cluster_manager_timeout'
- $ref: '#/components/parameters/put_script::query.context'
- $ref: '#/components/parameters/put_script::query.master_timeout'
- $ref: '#/components/parameters/put_script::query.timeout'
requestBody:
Expand Down Expand Up @@ -611,6 +613,7 @@ paths:
- $ref: '#/components/parameters/put_script::path.context'
- $ref: '#/components/parameters/put_script::path.id'
- $ref: '#/components/parameters/put_script::query.cluster_manager_timeout'
- $ref: '#/components/parameters/put_script::query.context'
- $ref: '#/components/parameters/put_script::query.master_timeout'
- $ref: '#/components/parameters/put_script::query.timeout'
requestBody:
Expand All @@ -629,6 +632,7 @@ paths:
- $ref: '#/components/parameters/put_script::path.context'
- $ref: '#/components/parameters/put_script::path.id'
- $ref: '#/components/parameters/put_script::query.cluster_manager_timeout'
- $ref: '#/components/parameters/put_script::query.context'
- $ref: '#/components/parameters/put_script::query.master_timeout'
- $ref: '#/components/parameters/put_script::query.timeout'
requestBody:
Expand Down Expand Up @@ -3478,10 +3482,7 @@ components:
description: Comma-separated list of specific routing values.
style: form
schema:
type: array
items:
type: string
description: Comma-separated list of specific routing values.
$ref: '../schemas/_common.yaml#/components/schemas/Routing'
explode: true
delete::path.id:
in: path
Expand Down Expand Up @@ -4863,6 +4864,14 @@ components:
schema:
$ref: '../schemas/_common.yaml#/components/schemas/Duration'
x-version-added: '2.0'
put_script::query.context:
name: context
in: query
description: |-
Context in which the script or search template should run.
To prevent errors, the API immediately compiles the script or template in this context.
schema:
type: string
put_script::query.master_timeout:
in: query
name: master_timeout
Expand Down Expand Up @@ -4920,7 +4929,7 @@ components:
name: search_type
description: Search operation type
schema:
type: string
$ref: '../schemas/_common.yaml#/components/schemas/SearchType'
style: form
reindex::query.max_docs:
name: max_docs
Expand Down
6 changes: 5 additions & 1 deletion spec/namespaces/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1274,7 +1274,11 @@ components:
name: metric
description: Limits the information returned to the specified metrics.
schema:
$ref: '../schemas/_common.yaml#/components/schemas/Metrics'
oneOf:
- $ref: '../schemas/cluster.reroute.yaml#/components/schemas/Metric'
- type: array
items:
$ref: '../schemas/cluster.reroute.yaml#/components/schemas/Metric'
style: form
cluster.reroute::query.retry_failed:
in: query
Expand Down
10 changes: 7 additions & 3 deletions spec/namespaces/indices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4773,10 +4773,10 @@ components:
description: List of shard health statuses used to limit the request.
schema:
oneOf:
- $ref: '../schemas/indices.shard_stores.yaml#/components/schemas/ShardStoreStatus'
- $ref: '../schemas/indices.shard_stores.yaml#/components/schemas/Status'
- type: array
items:
$ref: '../schemas/indices.shard_stores.yaml#/components/schemas/ShardStoreStatus'
$ref: '../schemas/indices.shard_stores.yaml#/components/schemas/Status'
style: form
indices.shrink::path.index:
in: path
Expand Down Expand Up @@ -5035,7 +5035,11 @@ components:
description: Limit the information returned the specific metrics.
required: true
schema:
$ref: '../schemas/_common.yaml#/components/schemas/Metrics'
oneOf:
- $ref: '../schemas/indices.stats.yaml#/components/schemas/Metric'
- type: array
items:
$ref: '../schemas/indices.stats.yaml#/components/schemas/Metric'
style: simple
indices.stats::query.completion_fields:
in: query
Expand Down
5 changes: 1 addition & 4 deletions spec/namespaces/knn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -500,10 +500,7 @@ components:
description: Comma-separated list of specific routing values.
style: form
schema:
type: array
items:
type: string
description: Comma-separated list of specific routing values.
$ref: '../schemas/_common.yaml#/components/schemas/Routing'
explode: true
knn.search_models::query.scroll:
name: scroll
Expand Down
12 changes: 5 additions & 7 deletions spec/schemas/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,11 @@ components:
ScrollId:
type: string
Routing:
type: string
oneOf:
- type: string
- type: array
items:
type: string
DateTime:
description: |-
A date and time, either as a string whose format can depend on the context (defaulting to ISO 8601), or a
Expand Down Expand Up @@ -919,12 +923,6 @@ components:
- urgent
DataStreamName:
type: string
Metrics:
oneOf:
- type: string
- type: array
items:
type: string
CompletionStats:
type: object
properties:
Expand Down
12 changes: 12 additions & 0 deletions spec/schemas/cluster.reroute.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,18 @@ components:
- index
- node
- shard
Metric:
type: string
enum:
- _all
- blocks
- cluster_manager_node
- master_node
- metadata
- nodes
- routing_nodes
- routing_table
- version
RerouteExplanation:
type: object
properties:
Expand Down
2 changes: 1 addition & 1 deletion spec/schemas/indices.shard_stores.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ info:
paths: {}
components:
schemas:
ShardStoreStatus:
Status:
type: string
enum:
- all
Expand Down
21 changes: 21 additions & 0 deletions spec/schemas/indices.stats.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,27 @@ components:
$ref: '#/components/schemas/ShardRetentionLeases'
shard_path:
$ref: '#/components/schemas/ShardPath'
Metric:
type: string
enum:
- _all
- completion
- docs
- fielddata
- flush
- get
- indexing
- merge
- query_cache
- recovery
- refresh
- request_cache
- search
- segments
- store
- suggest
- translog
- warmer
ShardCommit:
type: object
properties:
Expand Down

0 comments on commit 2487252

Please sign in to comment.