Skip to content

Commit

Permalink
Validate order of operations in spec operations. (#325)
Browse files Browse the repository at this point in the history
* Added order of operations validator.

Signed-off-by: dblock <[email protected]>
  • Loading branch information
dblock authored Jun 7, 2024
1 parent 64b747c commit e6597c0
Show file tree
Hide file tree
Showing 11 changed files with 310 additions and 264 deletions.
126 changes: 63 additions & 63 deletions spec/namespaces/_core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -534,21 +534,6 @@ paths:
'200':
$ref: '#/components/responses/scripts_painless_execute@200'
/_scripts/{id}:
delete:
operationId: delete_script.0
x-operation-group: delete_script
x-version-added: '1.0'
description: Deletes a script.
externalDocs:
url: https://opensearch.org/docs/latest/api-reference/script-apis/delete-script/
parameters:
- $ref: '#/components/parameters/delete_script::path.id'
- $ref: '#/components/parameters/delete_script::query.timeout'
- $ref: '#/components/parameters/delete_script::query.master_timeout'
- $ref: '#/components/parameters/delete_script::query.cluster_manager_timeout'
responses:
'200':
$ref: '#/components/responses/delete_script@200'
get:
operationId: get_script.0
x-operation-group: get_script
Expand Down Expand Up @@ -597,6 +582,21 @@ paths:
responses:
'200':
$ref: '#/components/responses/put_script@200'
delete:
operationId: delete_script.0
x-operation-group: delete_script
x-version-added: '1.0'
description: Deletes a script.
externalDocs:
url: https://opensearch.org/docs/latest/api-reference/script-apis/delete-script/
parameters:
- $ref: '#/components/parameters/delete_script::path.id'
- $ref: '#/components/parameters/delete_script::query.timeout'
- $ref: '#/components/parameters/delete_script::query.master_timeout'
- $ref: '#/components/parameters/delete_script::query.cluster_manager_timeout'
responses:
'200':
$ref: '#/components/responses/delete_script@200'
/_scripts/{id}/{context}:
post:
operationId: put_script.2
Expand Down Expand Up @@ -763,16 +763,6 @@ paths:
'200':
$ref: '#/components/responses/delete_pit@200'
/_search/point_in_time/_all:
delete:
operationId: delete_all_pits.0
x-operation-group: delete_all_pits
x-version-added: '2.4'
description: Deletes all active point in time searches.
externalDocs:
url: https://opensearch.org/docs/latest/search-plugins/point-in-time-api/#delete-pits
responses:
'200':
$ref: '#/components/responses/delete_all_pits@200'
get:
operationId: get_all_pits.0
x-operation-group: get_all_pits
Expand All @@ -783,20 +773,17 @@ paths:
responses:
'200':
$ref: '#/components/responses/get_all_pits@200'
/_search/scroll:
delete:
operationId: clear_scroll.0
x-operation-group: clear_scroll
x-version-added: '1.0'
description: Explicitly clears the search context for a scroll.
operationId: delete_all_pits.0
x-operation-group: delete_all_pits
x-version-added: '2.4'
description: Deletes all active point in time searches.
externalDocs:
url: https://opensearch.org/docs/latest/api-reference/scroll/
parameters: []
requestBody:
$ref: '#/components/requestBodies/clear_scroll'
url: https://opensearch.org/docs/latest/search-plugins/point-in-time-api/#delete-pits
responses:
'200':
$ref: '#/components/responses/clear_scroll@200'
$ref: '#/components/responses/delete_all_pits@200'
/_search/scroll:
get:
operationId: scroll.0
x-operation-group: scroll
Expand Down Expand Up @@ -829,24 +816,20 @@ paths:
responses:
'200':
$ref: '#/components/responses/scroll@200'
/_search/scroll/{scroll_id}:
delete:
operationId: clear_scroll.1
operationId: clear_scroll.0
x-operation-group: clear_scroll
deprecated: true
x-deprecation-message: A scroll id can be quite large and should be specified as part of the body
x-version-added: '1.0'
x-version-deprecated: '1.0'
description: Explicitly clears the search context for a scroll.
externalDocs:
url: https://opensearch.org/docs/latest/api-reference/scroll/
parameters:
- $ref: '#/components/parameters/clear_scroll::path.scroll_id'
parameters: []
requestBody:
$ref: '#/components/requestBodies/clear_scroll'
responses:
'200':
$ref: '#/components/responses/clear_scroll@200'
/_search/scroll/{scroll_id}:
get:
operationId: scroll.2
x-operation-group: scroll
Expand Down Expand Up @@ -887,6 +870,23 @@ paths:
responses:
'200':
$ref: '#/components/responses/scroll@200'
delete:
operationId: clear_scroll.1
x-operation-group: clear_scroll
deprecated: true
x-deprecation-message: A scroll id can be quite large and should be specified as part of the body
x-version-added: '1.0'
x-version-deprecated: '1.0'
description: Explicitly clears the search context for a scroll.
externalDocs:
url: https://opensearch.org/docs/latest/api-reference/scroll/
parameters:
- $ref: '#/components/parameters/clear_scroll::path.scroll_id'
requestBody:
$ref: '#/components/requestBodies/clear_scroll'
responses:
'200':
$ref: '#/components/responses/clear_scroll@200'
/_search/template:
get:
operationId: search_template.0
Expand Down Expand Up @@ -1221,27 +1221,6 @@ paths:
'200':
$ref: '#/components/responses/index@200'
/{index}/_doc/{id}:
delete:
operationId: delete.0
x-operation-group: delete
x-version-added: '1.0'
description: Removes a document from the index.
externalDocs:
url: https://opensearch.org/docs/latest/api-reference/document-apis/delete-document/
parameters:
- $ref: '#/components/parameters/delete::path.id'
- $ref: '#/components/parameters/delete::path.index'
- $ref: '#/components/parameters/delete::query.wait_for_active_shards'
- $ref: '#/components/parameters/delete::query.refresh'
- $ref: '#/components/parameters/delete::query.routing'
- $ref: '#/components/parameters/delete::query.timeout'
- $ref: '#/components/parameters/delete::query.if_seq_no'
- $ref: '#/components/parameters/delete::query.if_primary_term'
- $ref: '#/components/parameters/delete::query.version'
- $ref: '#/components/parameters/delete::query.version_type'
responses:
'200':
$ref: '#/components/responses/delete@200'
get:
operationId: get.0
x-operation-group: get
Expand Down Expand Up @@ -1340,6 +1319,27 @@ paths:
responses:
'200':
$ref: '#/components/responses/index@200'
delete:
operationId: delete.0
x-operation-group: delete
x-version-added: '1.0'
description: Removes a document from the index.
externalDocs:
url: https://opensearch.org/docs/latest/api-reference/document-apis/delete-document/
parameters:
- $ref: '#/components/parameters/delete::path.id'
- $ref: '#/components/parameters/delete::path.index'
- $ref: '#/components/parameters/delete::query.wait_for_active_shards'
- $ref: '#/components/parameters/delete::query.refresh'
- $ref: '#/components/parameters/delete::query.routing'
- $ref: '#/components/parameters/delete::query.timeout'
- $ref: '#/components/parameters/delete::query.if_seq_no'
- $ref: '#/components/parameters/delete::query.if_primary_term'
- $ref: '#/components/parameters/delete::query.version'
- $ref: '#/components/parameters/delete::query.version_type'
responses:
'200':
$ref: '#/components/responses/delete@200'
/{index}/_explain/{id}:
get:
operationId: explain.0
Expand Down
54 changes: 27 additions & 27 deletions spec/namespaces/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -328,18 +328,6 @@ paths:
'200':
$ref: '#/components/responses/cluster.stats@200'
/_cluster/voting_config_exclusions:
delete:
operationId: cluster.delete_voting_config_exclusions.0
x-operation-group: cluster.delete_voting_config_exclusions
x-version-added: '1.0'
description: Clears cluster voting config exclusions.
externalDocs:
url: https://opensearch.org/docs/latest
parameters:
- $ref: '#/components/parameters/cluster.delete_voting_config_exclusions::query.wait_for_removal'
responses:
'200':
$ref: '#/components/responses/cluster.delete_voting_config_exclusions@200'
post:
operationId: cluster.post_voting_config_exclusions.0
x-operation-group: cluster.post_voting_config_exclusions
Expand All @@ -354,6 +342,18 @@ paths:
responses:
'200':
$ref: '#/components/responses/cluster.post_voting_config_exclusions@200'
delete:
operationId: cluster.delete_voting_config_exclusions.0
x-operation-group: cluster.delete_voting_config_exclusions
x-version-added: '1.0'
description: Clears cluster voting config exclusions.
externalDocs:
url: https://opensearch.org/docs/latest
parameters:
- $ref: '#/components/parameters/cluster.delete_voting_config_exclusions::query.wait_for_removal'
responses:
'200':
$ref: '#/components/responses/cluster.delete_voting_config_exclusions@200'
/_component_template:
get:
operationId: cluster.get_component_template.0
Expand All @@ -370,21 +370,6 @@ paths:
'200':
$ref: '#/components/responses/cluster.get_component_template@200'
/_component_template/{name}:
delete:
operationId: cluster.delete_component_template.0
x-operation-group: cluster.delete_component_template
x-version-added: '1.0'
description: Deletes a component template.
externalDocs:
url: https://opensearch.org/docs/latest
parameters:
- $ref: '#/components/parameters/cluster.delete_component_template::path.name'
- $ref: '#/components/parameters/cluster.delete_component_template::query.timeout'
- $ref: '#/components/parameters/cluster.delete_component_template::query.master_timeout'
- $ref: '#/components/parameters/cluster.delete_component_template::query.cluster_manager_timeout'
responses:
'200':
$ref: '#/components/responses/cluster.delete_component_template@200'
get:
operationId: cluster.get_component_template.1
x-operation-group: cluster.get_component_template
Expand Down Expand Up @@ -451,6 +436,21 @@ paths:
responses:
'200':
$ref: '#/components/responses/cluster.put_component_template@200'
delete:
operationId: cluster.delete_component_template.0
x-operation-group: cluster.delete_component_template
x-version-added: '1.0'
description: Deletes a component template.
externalDocs:
url: https://opensearch.org/docs/latest
parameters:
- $ref: '#/components/parameters/cluster.delete_component_template::path.name'
- $ref: '#/components/parameters/cluster.delete_component_template::query.timeout'
- $ref: '#/components/parameters/cluster.delete_component_template::query.master_timeout'
- $ref: '#/components/parameters/cluster.delete_component_template::query.cluster_manager_timeout'
responses:
'200':
$ref: '#/components/responses/cluster.delete_component_template@200'
/_remote/info:
get:
operationId: cluster.remote_info.0
Expand Down
32 changes: 16 additions & 16 deletions spec/namespaces/dangling_indices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,6 @@ paths:
'200':
$ref: '#/components/responses/dangling_indices.list_dangling_indices@200'
/_dangling/{index_uuid}:
delete:
operationId: dangling_indices.delete_dangling_index.0
x-operation-group: dangling_indices.delete_dangling_index
x-version-added: '1.0'
description: Deletes the specified dangling index.
externalDocs:
url: https://opensearch.org/docs/latest/api-reference/index-apis/dangling-index/
parameters:
- $ref: '#/components/parameters/dangling_indices.delete_dangling_index::path.index_uuid'
- $ref: '#/components/parameters/dangling_indices.delete_dangling_index::query.accept_data_loss'
- $ref: '#/components/parameters/dangling_indices.delete_dangling_index::query.timeout'
- $ref: '#/components/parameters/dangling_indices.delete_dangling_index::query.master_timeout'
- $ref: '#/components/parameters/dangling_indices.delete_dangling_index::query.cluster_manager_timeout'
responses:
'200':
$ref: '#/components/responses/dangling_indices.delete_dangling_index@200'
post:
operationId: dangling_indices.import_dangling_index.0
x-operation-group: dangling_indices.import_dangling_index
Expand All @@ -49,6 +33,22 @@ paths:
responses:
'200':
$ref: '#/components/responses/dangling_indices.import_dangling_index@200'
delete:
operationId: dangling_indices.delete_dangling_index.0
x-operation-group: dangling_indices.delete_dangling_index
x-version-added: '1.0'
description: Deletes the specified dangling index.
externalDocs:
url: https://opensearch.org/docs/latest/api-reference/index-apis/dangling-index/
parameters:
- $ref: '#/components/parameters/dangling_indices.delete_dangling_index::path.index_uuid'
- $ref: '#/components/parameters/dangling_indices.delete_dangling_index::query.accept_data_loss'
- $ref: '#/components/parameters/dangling_indices.delete_dangling_index::query.timeout'
- $ref: '#/components/parameters/dangling_indices.delete_dangling_index::query.master_timeout'
- $ref: '#/components/parameters/dangling_indices.delete_dangling_index::query.cluster_manager_timeout'
responses:
'200':
$ref: '#/components/responses/dangling_indices.delete_dangling_index@200'
components:
requestBodies: {}
responses:
Expand Down
Loading

0 comments on commit e6597c0

Please sign in to comment.