Skip to content

Commit 64c22d9

Browse files
committed
Ignore missing query parameters in fleet rest-api-spec
The fleet APIs are deliberately not completely documented.
1 parent 1afed69 commit 64c22d9

File tree

3 files changed

+4
-63
lines changed

3 files changed

+4
-63
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 & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -641,21 +641,7 @@
641641
"response": []
642642
},
643643
"fleet.msearch": {
644-
"request": [
645-
"Request: query parameter 'allow_no_indices' does not exist in the json spec",
646-
"Request: query parameter 'ccs_minimize_roundtrips' does not exist in the json spec",
647-
"Request: query parameter 'expand_wildcards' does not exist in the json spec",
648-
"Request: query parameter 'ignore_throttled' does not exist in the json spec",
649-
"Request: query parameter 'ignore_unavailable' does not exist in the json spec",
650-
"Request: query parameter 'max_concurrent_searches' does not exist in the json spec",
651-
"Request: query parameter 'max_concurrent_shard_requests' does not exist in the json spec",
652-
"Request: query parameter 'pre_filter_shard_size' does not exist in the json spec",
653-
"Request: query parameter 'search_type' does not exist in the json spec",
654-
"Request: query parameter 'rest_total_hits_as_int' does not exist in the json spec",
655-
"Request: query parameter 'typed_keys' does not exist in the json spec",
656-
"Request: query parameter 'wait_for_checkpoints' does not exist in the json spec",
657-
"Request: query parameter 'allow_partial_search_results' does not exist in the json spec"
658-
],
644+
"request": [],
659645
"response": [
660646
"type_alias definition _global.msearch:ResponseItem / union_of / instance_of / Generics / instance_of - No type definition for '_global.msearch.ResponseItem:TDocument'"
661647
]
@@ -666,53 +652,6 @@
666652
],
667653
"response": []
668654
},
669-
"fleet.search": {
670-
"request": [
671-
"Request: query parameter 'allow_no_indices' does not exist in the json spec",
672-
"Request: query parameter 'analyzer' does not exist in the json spec",
673-
"Request: query parameter 'analyze_wildcard' does not exist in the json spec",
674-
"Request: query parameter 'batched_reduce_size' does not exist in the json spec",
675-
"Request: query parameter 'ccs_minimize_roundtrips' does not exist in the json spec",
676-
"Request: query parameter 'default_operator' does not exist in the json spec",
677-
"Request: query parameter 'df' does not exist in the json spec",
678-
"Request: query parameter 'docvalue_fields' does not exist in the json spec",
679-
"Request: query parameter 'expand_wildcards' does not exist in the json spec",
680-
"Request: query parameter 'explain' does not exist in the json spec",
681-
"Request: query parameter 'ignore_throttled' does not exist in the json spec",
682-
"Request: query parameter 'ignore_unavailable' does not exist in the json spec",
683-
"Request: query parameter 'lenient' does not exist in the json spec",
684-
"Request: query parameter 'max_concurrent_shard_requests' 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-
},
716655
"get_source": {
717656
"request": [
718657
"Request: query parameter 'stored_fields' does not exist in the json spec"

0 commit comments

Comments
 (0)