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

Added a linter for order of parameters. #369

Merged
merged 3 commits into from
Jun 30, 2024
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 @@ -31,6 +31,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Added support for `text/plain` responses in `_cat` APIs ([#360](https://github.com/opensearch-project/opensearch-api-specification/pull/360))
- Added support for `application/yaml` responses ([#363](https://github.com/opensearch-project/opensearch-api-specification/pull/363))
- Added test for search with seq_no_primary_term ([#367](https://github.com/opensearch-project/opensearch-api-specification/pull/367))
- Added a linter for parameter sorting ([#369](https://github.com/opensearch-project/opensearch-api-specification/pull/369))

### Changed

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"lint--fix": "eslint . --fix --report-unused-disable-directives",
"merge": "ts-node tools/src/merger/merge.ts",
"test": "npm run test:unit && npm run test:integ",
"jest": "jest",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I put this back because to run an individual test you can't do npm run test:unit -- ...test.ts, it has testMatch flags, but you can do npm run jest -- ...test.ts.

"test:unit": "jest --testMatch='**/*.test.ts' --testPathIgnorePatterns=/integ/",
"test:integ": "jest --testMatch='**/integ/*.test.ts' --runInBand",
"test:spec": "ts-node tools/src/tester/test.ts",
Expand Down
2 changes: 1 addition & 1 deletion spec/_global_parameters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ components:
- type: string
- type: array
items:
type: string
type: string
2 changes: 1 addition & 1 deletion spec/_info.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$schema: ./json_schemas/_info.schema.yaml

title: OpenSearch API Specification
version: 1.0.0
version: 1.0.0
568 changes: 284 additions & 284 deletions spec/namespaces/_core.yaml

Large diffs are not rendered by default.

200 changes: 100 additions & 100 deletions spec/namespaces/cat.yaml

Large diffs are not rendered by default.

82 changes: 41 additions & 41 deletions spec/namespaces/cluster.yaml

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions spec/namespaces/dangling_indices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ paths:
parameters:
- $ref: '#/components/parameters/dangling_indices.import_dangling_index::path.index_uuid'
- $ref: '#/components/parameters/dangling_indices.import_dangling_index::query.accept_data_loss'
- $ref: '#/components/parameters/dangling_indices.import_dangling_index::query.timeout'
- $ref: '#/components/parameters/dangling_indices.import_dangling_index::query.master_timeout'
- $ref: '#/components/parameters/dangling_indices.import_dangling_index::query.cluster_manager_timeout'
- $ref: '#/components/parameters/dangling_indices.import_dangling_index::query.master_timeout'
- $ref: '#/components/parameters/dangling_indices.import_dangling_index::query.timeout'
responses:
'200':
$ref: '#/components/responses/dangling_indices.import_dangling_index@200'
Expand All @@ -43,9 +43,9 @@ paths:
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'
- $ref: '#/components/parameters/dangling_indices.delete_dangling_index::query.master_timeout'
- $ref: '#/components/parameters/dangling_indices.delete_dangling_index::query.timeout'
responses:
'200':
$ref: '#/components/responses/dangling_indices.delete_dangling_index@200'
Expand Down
436 changes: 218 additions & 218 deletions spec/namespaces/indices.yaml

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions spec/namespaces/ingest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ paths:
externalDocs:
url: https://opensearch.org/docs/latest/api-reference/ingest-apis/get-ingest/
parameters:
- $ref: '#/components/parameters/ingest.get_pipeline::query.master_timeout'
- $ref: '#/components/parameters/ingest.get_pipeline::query.cluster_manager_timeout'
- $ref: '#/components/parameters/ingest.get_pipeline::query.master_timeout'
responses:
'200':
$ref: '#/components/responses/ingest.get_pipeline@200'
Expand Down Expand Up @@ -57,8 +57,8 @@ paths:
url: https://opensearch.org/docs/latest/api-reference/ingest-apis/get-ingest/
parameters:
- $ref: '#/components/parameters/ingest.get_pipeline::path.id'
- $ref: '#/components/parameters/ingest.get_pipeline::query.master_timeout'
- $ref: '#/components/parameters/ingest.get_pipeline::query.cluster_manager_timeout'
- $ref: '#/components/parameters/ingest.get_pipeline::query.master_timeout'
responses:
'200':
$ref: '#/components/responses/ingest.get_pipeline@200'
Expand All @@ -71,8 +71,8 @@ paths:
url: https://opensearch.org/docs/latest/api-reference/ingest-apis/create-update-ingest/
parameters:
- $ref: '#/components/parameters/ingest.put_pipeline::path.id'
- $ref: '#/components/parameters/ingest.put_pipeline::query.master_timeout'
- $ref: '#/components/parameters/ingest.put_pipeline::query.cluster_manager_timeout'
- $ref: '#/components/parameters/ingest.put_pipeline::query.master_timeout'
- $ref: '#/components/parameters/ingest.put_pipeline::query.timeout'
requestBody:
$ref: '#/components/requestBodies/ingest.put_pipeline'
Expand All @@ -88,8 +88,8 @@ paths:
url: https://opensearch.org/docs/latest/api-reference/ingest-apis/delete-ingest/
parameters:
- $ref: '#/components/parameters/ingest.delete_pipeline::path.id'
- $ref: '#/components/parameters/ingest.delete_pipeline::query.master_timeout'
- $ref: '#/components/parameters/ingest.delete_pipeline::query.cluster_manager_timeout'
- $ref: '#/components/parameters/ingest.delete_pipeline::query.master_timeout'
- $ref: '#/components/parameters/ingest.delete_pipeline::query.timeout'
responses:
'200':
Expand Down
68 changes: 34 additions & 34 deletions spec/namespaces/knn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,48 +13,48 @@ paths:
externalDocs:
url: https://opensearch.org/docs/latest/search-plugins/knn/api/#search-model
parameters:
- $ref: '#/components/parameters/knn.search_models::query.analyzer'
- $ref: '#/components/parameters/knn.search_models::query._source'
- $ref: '#/components/parameters/knn.search_models::query._source_excludes'
- $ref: '#/components/parameters/knn.search_models::query._source_includes'
- $ref: '#/components/parameters/knn.search_models::query.allow_no_indices'
- $ref: '#/components/parameters/knn.search_models::query.allow_partial_search_results'
- $ref: '#/components/parameters/knn.search_models::query.analyze_wildcard'
- $ref: '#/components/parameters/knn.search_models::query.analyzer'
- $ref: '#/components/parameters/knn.search_models::query.batched_reduce_size'
- $ref: '#/components/parameters/knn.search_models::query.ccs_minimize_roundtrips'
- $ref: '#/components/parameters/knn.search_models::query.default_operator'
- $ref: '#/components/parameters/knn.search_models::query.df'
- $ref: '#/components/parameters/knn.search_models::query.explain'
- $ref: '#/components/parameters/knn.search_models::query.stored_fields'
- $ref: '#/components/parameters/knn.search_models::query.docvalue_fields'
- $ref: '#/components/parameters/knn.search_models::query.expand_wildcards'
- $ref: '#/components/parameters/knn.search_models::query.explain'
- $ref: '#/components/parameters/knn.search_models::query.from'
- $ref: '#/components/parameters/knn.search_models::query.ignore_unavailable'
- $ref: '#/components/parameters/knn.search_models::query.ignore_throttled'
- $ref: '#/components/parameters/knn.search_models::query.allow_no_indices'
- $ref: '#/components/parameters/knn.search_models::query.expand_wildcards'
- $ref: '#/components/parameters/knn.search_models::query.ignore_unavailable'
- $ref: '#/components/parameters/knn.search_models::query.lenient'
- $ref: '#/components/parameters/knn.search_models::query.max_concurrent_shard_requests'
- $ref: '#/components/parameters/knn.search_models::query.pre_filter_shard_size'
- $ref: '#/components/parameters/knn.search_models::query.preference'
- $ref: '#/components/parameters/knn.search_models::query.q'
- $ref: '#/components/parameters/knn.search_models::query.request_cache'
- $ref: '#/components/parameters/knn.search_models::query.rest_total_hits_as_int'
- $ref: '#/components/parameters/knn.search_models::query.routing'
- $ref: '#/components/parameters/knn.search_models::query.scroll'
- $ref: '#/components/parameters/knn.search_models::query.search_type'
- $ref: '#/components/parameters/knn.search_models::query.seq_no_primary_term'
- $ref: '#/components/parameters/knn.search_models::query.size'
- $ref: '#/components/parameters/knn.search_models::query.sort'
- $ref: '#/components/parameters/knn.search_models::query._source'
- $ref: '#/components/parameters/knn.search_models::query._source_excludes'
- $ref: '#/components/parameters/knn.search_models::query._source_includes'
- $ref: '#/components/parameters/knn.search_models::query.terminate_after'
- $ref: '#/components/parameters/knn.search_models::query.stats'
- $ref: '#/components/parameters/knn.search_models::query.stored_fields'
- $ref: '#/components/parameters/knn.search_models::query.suggest_field'
- $ref: '#/components/parameters/knn.search_models::query.suggest_mode'
- $ref: '#/components/parameters/knn.search_models::query.suggest_size'
- $ref: '#/components/parameters/knn.search_models::query.suggest_text'
- $ref: '#/components/parameters/knn.search_models::query.terminate_after'
- $ref: '#/components/parameters/knn.search_models::query.timeout'
- $ref: '#/components/parameters/knn.search_models::query.track_scores'
- $ref: '#/components/parameters/knn.search_models::query.track_total_hits'
- $ref: '#/components/parameters/knn.search_models::query.allow_partial_search_results'
- $ref: '#/components/parameters/knn.search_models::query.typed_keys'
- $ref: '#/components/parameters/knn.search_models::query.version'
- $ref: '#/components/parameters/knn.search_models::query.seq_no_primary_term'
- $ref: '#/components/parameters/knn.search_models::query.request_cache'
- $ref: '#/components/parameters/knn.search_models::query.batched_reduce_size'
- $ref: '#/components/parameters/knn.search_models::query.max_concurrent_shard_requests'
- $ref: '#/components/parameters/knn.search_models::query.pre_filter_shard_size'
- $ref: '#/components/parameters/knn.search_models::query.rest_total_hits_as_int'
requestBody:
$ref: '#/components/requestBodies/knn.search_models'
responses:
Expand All @@ -68,48 +68,48 @@ paths:
externalDocs:
url: https://opensearch.org/docs/latest/search-plugins/knn/api/#search-model
parameters:
- $ref: '#/components/parameters/knn.search_models::query.analyzer'
- $ref: '#/components/parameters/knn.search_models::query._source'
- $ref: '#/components/parameters/knn.search_models::query._source_excludes'
- $ref: '#/components/parameters/knn.search_models::query._source_includes'
- $ref: '#/components/parameters/knn.search_models::query.allow_no_indices'
- $ref: '#/components/parameters/knn.search_models::query.allow_partial_search_results'
- $ref: '#/components/parameters/knn.search_models::query.analyze_wildcard'
- $ref: '#/components/parameters/knn.search_models::query.analyzer'
- $ref: '#/components/parameters/knn.search_models::query.batched_reduce_size'
- $ref: '#/components/parameters/knn.search_models::query.ccs_minimize_roundtrips'
- $ref: '#/components/parameters/knn.search_models::query.default_operator'
- $ref: '#/components/parameters/knn.search_models::query.df'
- $ref: '#/components/parameters/knn.search_models::query.explain'
- $ref: '#/components/parameters/knn.search_models::query.stored_fields'
- $ref: '#/components/parameters/knn.search_models::query.docvalue_fields'
- $ref: '#/components/parameters/knn.search_models::query.expand_wildcards'
- $ref: '#/components/parameters/knn.search_models::query.explain'
- $ref: '#/components/parameters/knn.search_models::query.from'
- $ref: '#/components/parameters/knn.search_models::query.ignore_unavailable'
- $ref: '#/components/parameters/knn.search_models::query.ignore_throttled'
- $ref: '#/components/parameters/knn.search_models::query.allow_no_indices'
- $ref: '#/components/parameters/knn.search_models::query.expand_wildcards'
- $ref: '#/components/parameters/knn.search_models::query.ignore_unavailable'
- $ref: '#/components/parameters/knn.search_models::query.lenient'
- $ref: '#/components/parameters/knn.search_models::query.max_concurrent_shard_requests'
- $ref: '#/components/parameters/knn.search_models::query.pre_filter_shard_size'
- $ref: '#/components/parameters/knn.search_models::query.preference'
- $ref: '#/components/parameters/knn.search_models::query.q'
- $ref: '#/components/parameters/knn.search_models::query.request_cache'
- $ref: '#/components/parameters/knn.search_models::query.rest_total_hits_as_int'
- $ref: '#/components/parameters/knn.search_models::query.routing'
- $ref: '#/components/parameters/knn.search_models::query.scroll'
- $ref: '#/components/parameters/knn.search_models::query.search_type'
- $ref: '#/components/parameters/knn.search_models::query.seq_no_primary_term'
- $ref: '#/components/parameters/knn.search_models::query.size'
- $ref: '#/components/parameters/knn.search_models::query.sort'
- $ref: '#/components/parameters/knn.search_models::query._source'
- $ref: '#/components/parameters/knn.search_models::query._source_excludes'
- $ref: '#/components/parameters/knn.search_models::query._source_includes'
- $ref: '#/components/parameters/knn.search_models::query.terminate_after'
- $ref: '#/components/parameters/knn.search_models::query.stats'
- $ref: '#/components/parameters/knn.search_models::query.stored_fields'
- $ref: '#/components/parameters/knn.search_models::query.suggest_field'
- $ref: '#/components/parameters/knn.search_models::query.suggest_mode'
- $ref: '#/components/parameters/knn.search_models::query.suggest_size'
- $ref: '#/components/parameters/knn.search_models::query.suggest_text'
- $ref: '#/components/parameters/knn.search_models::query.terminate_after'
- $ref: '#/components/parameters/knn.search_models::query.timeout'
- $ref: '#/components/parameters/knn.search_models::query.track_scores'
- $ref: '#/components/parameters/knn.search_models::query.track_total_hits'
- $ref: '#/components/parameters/knn.search_models::query.allow_partial_search_results'
- $ref: '#/components/parameters/knn.search_models::query.typed_keys'
- $ref: '#/components/parameters/knn.search_models::query.version'
- $ref: '#/components/parameters/knn.search_models::query.seq_no_primary_term'
- $ref: '#/components/parameters/knn.search_models::query.request_cache'
- $ref: '#/components/parameters/knn.search_models::query.batched_reduce_size'
- $ref: '#/components/parameters/knn.search_models::query.max_concurrent_shard_requests'
- $ref: '#/components/parameters/knn.search_models::query.pre_filter_shard_size'
- $ref: '#/components/parameters/knn.search_models::query.rest_total_hits_as_int'
requestBody:
$ref: '#/components/requestBodies/knn.search_models'
responses:
Expand Down
Loading
Loading