Skip to content

Commit adcd1b1

Browse files
authored
Ignore missing query parameters in fleet rest-api-spec (#3166) (#3262)
(cherry picked from commit 7dc96a3)
1 parent 203259f commit adcd1b1

File tree

3 files changed

+4
-64
lines changed

3 files changed

+4
-64
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/schema/validation-errors.json

Lines changed: 1 addition & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -532,21 +532,7 @@
532532
"response": []
533533
},
534534
"fleet.msearch": {
535-
"request": [
536-
"Request: query parameter 'allow_no_indices' does not exist in the json spec",
537-
"Request: query parameter 'ccs_minimize_roundtrips' does not exist in the json spec",
538-
"Request: query parameter 'expand_wildcards' does not exist in the json spec",
539-
"Request: query parameter 'ignore_throttled' does not exist in the json spec",
540-
"Request: query parameter 'ignore_unavailable' does not exist in the json spec",
541-
"Request: query parameter 'max_concurrent_searches' does not exist in the json spec",
542-
"Request: query parameter 'max_concurrent_shard_requests' does not exist in the json spec",
543-
"Request: query parameter 'pre_filter_shard_size' does not exist in the json spec",
544-
"Request: query parameter 'search_type' does not exist in the json spec",
545-
"Request: query parameter 'rest_total_hits_as_int' does not exist in the json spec",
546-
"Request: query parameter 'typed_keys' does not exist in the json spec",
547-
"Request: query parameter 'wait_for_checkpoints' does not exist in the json spec",
548-
"Request: query parameter 'allow_partial_search_results' does not exist in the json spec"
549-
],
535+
"request": [],
550536
"response": [
551537
"type_alias definition _global.msearch:ResponseItem / union_of / instance_of / Generics / instance_of - No type definition for '_global.msearch.ResponseItem:TDocument'"
552538
]
@@ -557,54 +543,6 @@
557543
],
558544
"response": []
559545
},
560-
"fleet.search": {
561-
"request": [
562-
"Request: query parameter 'allow_no_indices' does not exist in the json spec",
563-
"Request: query parameter 'analyzer' does not exist in the json spec",
564-
"Request: query parameter 'analyze_wildcard' does not exist in the json spec",
565-
"Request: query parameter 'batched_reduce_size' does not exist in the json spec",
566-
"Request: query parameter 'ccs_minimize_roundtrips' does not exist in the json spec",
567-
"Request: query parameter 'default_operator' does not exist in the json spec",
568-
"Request: query parameter 'df' does not exist in the json spec",
569-
"Request: query parameter 'docvalue_fields' does not exist in the json spec",
570-
"Request: query parameter 'expand_wildcards' does not exist in the json spec",
571-
"Request: query parameter 'explain' does not exist in the json spec",
572-
"Request: query parameter 'ignore_throttled' does not exist in the json spec",
573-
"Request: query parameter 'ignore_unavailable' does not exist in the json spec",
574-
"Request: query parameter 'lenient' does not exist in the json spec",
575-
"Request: query parameter 'max_concurrent_shard_requests' does not exist in the json spec",
576-
"Request: query parameter 'min_compatible_shard_node' does not exist in the json spec",
577-
"Request: query parameter 'preference' does not exist in the json spec",
578-
"Request: query parameter 'pre_filter_shard_size' does not exist in the json spec",
579-
"Request: query parameter 'request_cache' does not exist in the json spec",
580-
"Request: query parameter 'routing' does not exist in the json spec",
581-
"Request: query parameter 'scroll' does not exist in the json spec",
582-
"Request: query parameter 'search_type' does not exist in the json spec",
583-
"Request: query parameter 'stats' does not exist in the json spec",
584-
"Request: query parameter 'stored_fields' does not exist in the json spec",
585-
"Request: query parameter 'suggest_field' does not exist in the json spec",
586-
"Request: query parameter 'suggest_mode' does not exist in the json spec",
587-
"Request: query parameter 'suggest_size' does not exist in the json spec",
588-
"Request: query parameter 'suggest_text' does not exist in the json spec",
589-
"Request: query parameter 'terminate_after' does not exist in the json spec",
590-
"Request: query parameter 'timeout' does not exist in the json spec",
591-
"Request: query parameter 'track_total_hits' does not exist in the json spec",
592-
"Request: query parameter 'track_scores' does not exist in the json spec",
593-
"Request: query parameter 'typed_keys' does not exist in the json spec",
594-
"Request: query parameter 'rest_total_hits_as_int' does not exist in the json spec",
595-
"Request: query parameter 'version' does not exist in the json spec",
596-
"Request: query parameter '_source' does not exist in the json spec",
597-
"Request: query parameter '_source_excludes' does not exist in the json spec",
598-
"Request: query parameter '_source_includes' does not exist in the json spec",
599-
"Request: query parameter 'seq_no_primary_term' does not exist in the json spec",
600-
"Request: query parameter 'q' does not exist in the json spec",
601-
"Request: query parameter 'size' does not exist in the json spec",
602-
"Request: query parameter 'from' does not exist in the json spec",
603-
"Request: query parameter 'sort' does not exist in the json spec",
604-
"Request: missing json spec query parameter 'wait_for_checkpoints_timeout'"
605-
],
606-
"response": []
607-
},
608546
"get_source": {
609547
"request": [
610548
"Request: query parameter 'stored_fields' does not exist in the json spec"

0 commit comments

Comments
 (0)