Skip to content

Commit 2a77e79

Browse files
authored
rest-api-spec: Add missing options to enum types (#136640)
* rest-api-spec: Add missing options to enum types * Allow 0-9 in enum options
1 parent dd9cdd9 commit 2a77e79

12 files changed

+103
-27
lines changed

rest-api-spec/src/main/resources/rest-api-spec/api/cat.segments.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,13 @@
108108
},
109109
"expand_wildcards": {
110110
"type": "enum",
111-
"options": ["open", "closed", "hidden", "none", "all"],
111+
"options": [
112+
"open",
113+
"closed",
114+
"hidden",
115+
"none",
116+
"all"
117+
],
112118
"default": "open",
113119
"description": "Whether to expand wildcard expression to concrete indices that are open, closed or both."
114120
},

rest-api-spec/src/main/resources/rest-api-spec/api/connector.sync_job_list.json

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,17 @@
3333
"description": "specifies a max number of results to get (default: 100)"
3434
},
3535
"status": {
36-
"type": "string",
37-
"description": "Sync job status, which sync jobs are fetched for"
36+
"type": "enum",
37+
"description": "A sync job status to fetch connector sync jobs for",
38+
"options": [
39+
"canceling",
40+
"canceled",
41+
"completed",
42+
"error",
43+
"in_progress",
44+
"pending",
45+
"suspended"
46+
]
3847
},
3948
"connector_id": {
4049
"type": "string",

rest-api-spec/src/main/resources/rest-api-spec/api/esql.async_query.json

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,18 @@
2626
},
2727
"params": {
2828
"format": {
29-
"type": "string",
30-
"description": "a short version of the Accept header, e.g. json, yaml"
29+
"type": "enum",
30+
"description": "A short version of the Accept header, e.g. json, yaml.\n\n`csv`, `tsv`, and `txt` formats will return results in a tabular format, excluding other metadata fields from the response.\n\nFor async requests, nothing will be returned if the async query doesn't finish within the timeout.\nThe query ID and running status are available in the `X-Elasticsearch-Async-Id` and `X-Elasticsearch-Async-Is-Running` HTTP headers of the response, respectively.",
31+
"options": [
32+
"csv",
33+
"json",
34+
"tsv",
35+
"txt",
36+
"yaml",
37+
"cbor",
38+
"smile",
39+
"arrow"
40+
]
3141
},
3242
"delimiter": {
3343
"type": "string",

rest-api-spec/src/main/resources/rest-api-spec/api/esql.async_query_get.json

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,18 @@
2929
},
3030
"params": {
3131
"format": {
32-
"type": "string",
33-
"description": "a short version of the Accept header, e.g. json, yaml"
32+
"type": "enum",
33+
"description": "A short version of the Accept header, for example `json` or `yaml`.",
34+
"options": [
35+
"csv",
36+
"json",
37+
"tsv",
38+
"txt",
39+
"yaml",
40+
"cbor",
41+
"smile",
42+
"arrow"
43+
]
3444
},
3545
"wait_for_completion_timeout": {
3646
"type": "time",

rest-api-spec/src/main/resources/rest-api-spec/api/esql.query.json

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,18 @@
2626
},
2727
"params": {
2828
"format": {
29-
"type": "string",
30-
"description": "a short version of the Accept header, e.g. json, yaml"
29+
"type": "enum",
30+
"description": "A short version of the Accept header, e.g. json, yaml.\n\n`csv`, `tsv`, and `txt` formats will return results in a tabular format, excluding other metadata fields from the response.",
31+
"options": [
32+
"csv",
33+
"json",
34+
"tsv",
35+
"txt",
36+
"yaml",
37+
"cbor",
38+
"smile",
39+
"arrow"
40+
]
3141
},
3242
"delimiter": {
3343
"type": "string",

rest-api-spec/src/main/resources/rest-api-spec/api/ml.get_trained_models.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,15 @@
4040
"default": true
4141
},
4242
"include": {
43-
"type": "string",
44-
"description": "A comma-separate list of fields to optionally include. Valid options are 'definition' and 'total_feature_importance'. Default is none."
43+
"type": "enum",
44+
"description": "A comma delimited string of optional fields to include in the response\nbody.",
45+
"options": [
46+
"definition",
47+
"feature_importance_baseline",
48+
"hyperparameters",
49+
"total_feature_importance",
50+
"definition_status"
51+
]
4552
},
4653
"decompress_definition": {
4754
"type": "boolean",

rest-api-spec/src/main/resources/rest-api-spec/api/ml.start_trained_model_deployment.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,12 @@
5151
"default": 1
5252
},
5353
"priority": {
54-
"type": "string",
54+
"type": "enum",
5555
"description": "The deployment priority.",
56-
"default": "normal"
56+
"options": [
57+
"normal",
58+
"low"
59+
]
5760
},
5861
"queue_capacity": {
5962
"type": "int",
@@ -66,11 +69,11 @@
6669
"default": "20s"
6770
},
6871
"wait_for": {
69-
"type": "string",
70-
"description": "The allocation status for which to wait",
72+
"type": "enum",
73+
"description": "Specifies the allocation status to wait for before returning.",
7174
"options": [
72-
"starting",
7375
"started",
76+
"starting",
7477
"fully_allocated"
7578
],
7679
"default": "started"

rest-api-spec/src/main/resources/rest-api-spec/api/simulate.ingest.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,12 @@
4444
"description": "The pipeline id to preprocess incoming documents with if no pipeline is given for a particular document"
4545
},
4646
"merge_type": {
47-
"type": "string",
48-
"description": "The mapping merge type if mapping overrides are being provided in mapping_addition. The allowed values are one of index or template. The index option merges mappings the way they would be merged into an existing index. The template option merges mappings the way they would be merged into a template.",
47+
"type": "enum",
48+
"description": "The mapping merge type if mapping overrides are being provided in mapping_addition.\nThe allowed values are one of index or template.\nThe index option merges mappings the way they would be merged into an existing index.\nThe template option merges mappings the way they would be merged into a template.",
49+
"options": [
50+
"index",
51+
"template"
52+
],
4953
"default": "index"
5054
}
5155
},

rest-api-spec/src/main/resources/rest-api-spec/api/sql.query.json

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,17 @@
2727
},
2828
"params": {
2929
"format": {
30-
"type": "string",
31-
"description": "a short version of the Accept header, e.g. json, yaml"
30+
"type": "enum",
31+
"description": "The format for the response.\nYou can also specify a format using the `Accept` HTTP header.\nIf you specify both this parameter and the `Accept` HTTP header, this parameter takes precedence.",
32+
"options": [
33+
"csv",
34+
"json",
35+
"tsv",
36+
"txt",
37+
"yaml",
38+
"cbor",
39+
"smile"
40+
]
3241
},
3342
"project_routing": {
3443
"type": "string",

rest-api-spec/src/main/resources/rest-api-spec/api/text_structure.find_field_structure.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,13 @@
7373
"description": "Optional parameter to specify the Grok pattern that should be used to extract fields from messages in a semi-structured text file"
7474
},
7575
"ecs_compatibility": {
76-
"type": "string",
77-
"default": "disabled",
78-
"description": "Optional parameter to specify the compatibility mode with ECS Grok patterns - may be either 'v1' or 'disabled'"
76+
"type": "enum",
77+
"description": "The mode of compatibility with ECS compliant Grok patterns.\nUse this parameter to specify whether to use ECS Grok patterns instead of legacy ones when the structure finder creates a Grok pattern.\nThis setting primarily has an impact when a whole message Grok pattern such as `%{CATALINALOG}` matches the input.\nIf the structure finder identifies a common structure but has no idea of the meaning then generic field names such as `path`, `ipaddress`, `field1`, and `field2` are used in the `grok_pattern` output.\nThe intention in that situation is that a user who knows the meanings will rename the fields before using them.",
78+
"options": [
79+
"disabled",
80+
"v1"
81+
],
82+
"default": "disabled"
7983
},
8084
"timestamp_field": {
8185
"type": "string",

0 commit comments

Comments
 (0)