Skip to content

Commit 16dd121

Browse files
authored
rest-api-spec: Enforce body "required" field (#136356) (#136370)
* rest-api-spec: Enforce body "required" field * Fix required status after YAML test run (cherry picked from commit cb779fc) # Conflicts: # rest-api-spec/src/main/resources/rest-api-spec/api/inference.put_ai21.json # rest-api-spec/src/main/resources/rest-api-spec/api/inference.put_contextualai.json # rest-api-spec/src/main/resources/rest-api-spec/api/inference.put_llama.json
1 parent 40a17a4 commit 16dd121

File tree

74 files changed

+148
-74
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+148
-74
lines changed

rest-api-spec/src/main/resources/rest-api-spec/api/async_search.submit.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,8 @@
243243
}
244244
},
245245
"body": {
246-
"description": "The search definition using the Query DSL"
246+
"description": "The search definition using the Query DSL",
247+
"required": false
247248
}
248249
}
249250
}

rest-api-spec/src/main/resources/rest-api-spec/api/clear_scroll.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@
4444
},
4545
"params": {},
4646
"body": {
47-
"description": "A comma-separated list of scroll IDs to clear if none was specified via the scroll_id parameter"
47+
"description": "A comma-separated list of scroll IDs to clear if none was specified via the scroll_id parameter",
48+
"required": false
4849
}
4950
}
5051
}

rest-api-spec/src/main/resources/rest-api-spec/api/close_point_in_time.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
},
2727
"params": {},
2828
"body": {
29-
"description": "a point-in-time id to close"
29+
"description": "a point-in-time id to close",
30+
"required": true
3031
}
3132
}
3233
}

rest-api-spec/src/main/resources/rest-api-spec/api/cluster.allocation_explain.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@
4343
}
4444
},
4545
"body": {
46-
"description": "The index, shard, and primary flag to explain. Empty means 'explain a randomly-chosen unassigned shard'"
46+
"description": "The index, shard, and primary flag to explain. Empty means 'explain a randomly-chosen unassigned shard'",
47+
"required": false
4748
}
4849
}
4950
}

rest-api-spec/src/main/resources/rest-api-spec/api/cluster.reroute.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@
6767
}
6868
},
6969
"body": {
70-
"description": "The definition of `commands` to perform (`move`, `cancel`, `allocate`)"
70+
"description": "The definition of `commands` to perform (`move`, `cancel`, `allocate`)",
71+
"required": false
7172
}
7273
}
7374
}

rest-api-spec/src/main/resources/rest-api-spec/api/count.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@
115115
}
116116
},
117117
"body": {
118-
"description": "A query to restrict the results specified with the Query DSL (optional)"
118+
"description": "A query to restrict the results specified with the Query DSL (optional)",
119+
"required": false
119120
}
120121
}
121122
}

rest-api-spec/src/main/resources/rest-api-spec/api/explain.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@
9393
}
9494
},
9595
"body": {
96-
"description": "The query definition using the Query DSL"
96+
"description": "The query definition using the Query DSL",
97+
"required": false
9798
}
9899
}
99100
}

rest-api-spec/src/main/resources/rest-api-spec/api/field_caps.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@
8585
}
8686
},
8787
"body": {
88-
"description": "An index filter specified with the Query DSL"
88+
"description": "An index filter specified with the Query DSL",
89+
"required": false
8990
}
9091
}
9192
}

rest-api-spec/src/main/resources/rest-api-spec/api/fleet.search.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@
4848
}
4949
},
5050
"body": {
51-
"description": "The search definition using the Query DSL"
51+
"description": "The search definition using the Query DSL",
52+
"required": true
5253
}
5354
}
5455
}

rest-api-spec/src/main/resources/rest-api-spec/api/graph.explore.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@
4242
}
4343
},
4444
"body": {
45-
"description": "Graph Query DSL"
45+
"description": "Graph Query DSL",
46+
"required": true
4647
}
4748
}
4849
}

0 commit comments

Comments
 (0)