Skip to content

Commit 4ac1b34

Browse files
committed
Ignore missing query parameters in fleet rest-api-spec (#3166)
(cherry picked from commit 7dc96a3)
1 parent 4e96fd9 commit 4ac1b34

File tree

8 files changed

+110
-94
lines changed

8 files changed

+110
-94
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,5 +233,6 @@ dist/* binary
233233
### Linguist Overrides #############################################################################
234234

235235
output/** linguist-generated=true
236+
output/schema/validation-errors.json linguist-generated=false
236237

237238
####################################################################################################

compiler/src/steps/validate-rest-spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ export default async function validateRestSpec (model: model.Model, jsonSpec: Ma
9797
}
9898
}
9999

100-
if (spec.params != null) {
100+
// fleet API are deliberately undocumented in rest-api-spec)
101+
if (spec.params != null && !endpoint.name.startsWith('fleet.')) {
101102
const params = Object.keys(spec.params)
102103
const queryProperties = requestProperties.query.map(property => property.name)
103104
// are all the parameters in the request definition present in the json spec?

output/openapi/elasticsearch-openapi.json

Lines changed: 16 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/openapi/elasticsearch-serverless-openapi.json

Lines changed: 16 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/schema/schema-serverless.json

Lines changed: 36 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/schema/schema.json

Lines changed: 36 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/schema/validation-errors.json

Lines changed: 1 addition & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -640,21 +640,7 @@
640640
"response": []
641641
},
642642
"fleet.msearch": {
643-
"request": [
644-
"Request: query parameter 'allow_no_indices' does not exist in the json spec",
645-
"Request: query parameter 'ccs_minimize_roundtrips' does not exist in the json spec",
646-
"Request: query parameter 'expand_wildcards' does not exist in the json spec",
647-
"Request: query parameter 'ignore_throttled' does not exist in the json spec",
648-
"Request: query parameter 'ignore_unavailable' does not exist in the json spec",
649-
"Request: query parameter 'max_concurrent_searches' does not exist in the json spec",
650-
"Request: query parameter 'max_concurrent_shard_requests' does not exist in the json spec",
651-
"Request: query parameter 'pre_filter_shard_size' does not exist in the json spec",
652-
"Request: query parameter 'search_type' does not exist in the json spec",
653-
"Request: query parameter 'rest_total_hits_as_int' does not exist in the json spec",
654-
"Request: query parameter 'typed_keys' does not exist in the json spec",
655-
"Request: query parameter 'wait_for_checkpoints' does not exist in the json spec",
656-
"Request: query parameter 'allow_partial_search_results' does not exist in the json spec"
657-
],
643+
"request": [],
658644
"response": [
659645
"type_alias definition _global.msearch:ResponseItem / union_of / instance_of / Generics / instance_of - No type definition for '_global.msearch.ResponseItem:TDocument'"
660646
]
@@ -665,54 +651,6 @@
665651
],
666652
"response": []
667653
},
668-
"fleet.search": {
669-
"request": [
670-
"Request: query parameter 'allow_no_indices' does not exist in the json spec",
671-
"Request: query parameter 'analyzer' does not exist in the json spec",
672-
"Request: query parameter 'analyze_wildcard' does not exist in the json spec",
673-
"Request: query parameter 'batched_reduce_size' does not exist in the json spec",
674-
"Request: query parameter 'ccs_minimize_roundtrips' does not exist in the json spec",
675-
"Request: query parameter 'default_operator' does not exist in the json spec",
676-
"Request: query parameter 'df' does not exist in the json spec",
677-
"Request: query parameter 'docvalue_fields' does not exist in the json spec",
678-
"Request: query parameter 'expand_wildcards' does not exist in the json spec",
679-
"Request: query parameter 'explain' does not exist in the json spec",
680-
"Request: query parameter 'ignore_throttled' does not exist in the json spec",
681-
"Request: query parameter 'ignore_unavailable' does not exist in the json spec",
682-
"Request: query parameter 'lenient' does not exist in the json spec",
683-
"Request: query parameter 'max_concurrent_shard_requests' does not exist in the json spec",
684-
"Request: query parameter 'min_compatible_shard_node' does not exist in the json spec",
685-
"Request: query parameter 'preference' does not exist in the json spec",
686-
"Request: query parameter 'pre_filter_shard_size' does not exist in the json spec",
687-
"Request: query parameter 'request_cache' does not exist in the json spec",
688-
"Request: query parameter 'routing' does not exist in the json spec",
689-
"Request: query parameter 'scroll' does not exist in the json spec",
690-
"Request: query parameter 'search_type' does not exist in the json spec",
691-
"Request: query parameter 'stats' does not exist in the json spec",
692-
"Request: query parameter 'stored_fields' does not exist in the json spec",
693-
"Request: query parameter 'suggest_field' does not exist in the json spec",
694-
"Request: query parameter 'suggest_mode' does not exist in the json spec",
695-
"Request: query parameter 'suggest_size' does not exist in the json spec",
696-
"Request: query parameter 'suggest_text' does not exist in the json spec",
697-
"Request: query parameter 'terminate_after' does not exist in the json spec",
698-
"Request: query parameter 'timeout' does not exist in the json spec",
699-
"Request: query parameter 'track_total_hits' does not exist in the json spec",
700-
"Request: query parameter 'track_scores' does not exist in the json spec",
701-
"Request: query parameter 'typed_keys' does not exist in the json spec",
702-
"Request: query parameter 'rest_total_hits_as_int' does not exist in the json spec",
703-
"Request: query parameter 'version' does not exist in the json spec",
704-
"Request: query parameter '_source' does not exist in the json spec",
705-
"Request: query parameter '_source_excludes' does not exist in the json spec",
706-
"Request: query parameter '_source_includes' does not exist in the json spec",
707-
"Request: query parameter 'seq_no_primary_term' does not exist in the json spec",
708-
"Request: query parameter 'q' does not exist in the json spec",
709-
"Request: query parameter 'size' does not exist in the json spec",
710-
"Request: query parameter 'from' does not exist in the json spec",
711-
"Request: query parameter 'sort' does not exist in the json spec",
712-
"Request: missing json spec query parameter 'wait_for_checkpoints_timeout'"
713-
],
714-
"response": []
715-
},
716654
"get_source": {
717655
"request": [
718656
"Request: query parameter 'stored_fields' does not exist in the json spec"

output/typescript/types.ts

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)