From 497c65206fe15f07c7f5caeedb60258160b8bbc2 Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Mon, 13 Oct 2025 17:00:01 +0400 Subject: [PATCH] Specification fixes (#5472) * Remove VersionType.force It got removed in 2019 in Elasticsearch 7.5. * Switch to lowercase default_operator They are the default values used in the Operator enum. * Fix streams.status master_timeout * Run make contrib (cherry picked from commit c59570341f6984f98e056f0a6df367729d57d85d) # Conflicts: # output/schema/schema.json --- output/openapi/elasticsearch-openapi.json | 15 ++- .../elasticsearch-serverless-openapi.json | 15 ++- output/schema/schema.json | 104 +++++++++--------- output/typescript/types.ts | 4 +- specification/_global/count/CountRequest.ts | 4 +- .../delete_by_query/DeleteByQueryRequest.ts | 4 +- .../_global/explain/ExplainRequest.ts | 4 +- specification/_global/search/SearchRequest.ts | 4 +- .../update_by_query/UpdateByQueryRequest.ts | 4 +- specification/_types/common.ts | 6 +- .../IndicesValidateQueryRequest.ts | 4 +- .../streams/status/StreamsStatusRequest.ts | 4 +- 12 files changed, 81 insertions(+), 91 deletions(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 8523b144b0..a7cc3994c5 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -9301,7 +9301,7 @@ { "in": "query", "name": "default_operator", - "description": "The default operator for query string query: `AND` or `OR`.\nThis parameter can be used only when the `q` query string parameter is specified.", + "description": "The default operator for query string query: `and` or `or`.\nThis parameter can be used only when the `q` query string parameter is specified.", "deprecated": false, "schema": { "$ref": "#/components/schemas/_types.query_dsl.Operator" @@ -50584,7 +50584,7 @@ { "in": "query", "name": "default_operator", - "description": "The default operator for query string query: `AND` or `OR`.\nThis parameter can be used only when the `q` query string parameter is specified.", + "description": "The default operator for query string query: `and` or `or`.\nThis parameter can be used only when the `q` query string parameter is specified.", "deprecated": false, "schema": { "$ref": "#/components/schemas/_types.query_dsl.Operator" @@ -63096,8 +63096,7 @@ "enum": [ "internal", "external", - "external_gte", - "force" + "external_gte" ] }, "_types.analysis.StopWords": { @@ -135634,7 +135633,7 @@ "count-default_operator": { "in": "query", "name": "default_operator", - "description": "The default operator for query string query: `AND` or `OR`.\nThis parameter can be used only when the `q` query string parameter is specified.", + "description": "The default operator for query string query: `and` or `or`.\nThis parameter can be used only when the `q` query string parameter is specified.", "deprecated": false, "schema": { "$ref": "#/components/schemas/_types.query_dsl.Operator" @@ -136030,7 +136029,7 @@ "explain-default_operator": { "in": "query", "name": "default_operator", - "description": "The default operator for query string query: `AND` or `OR`.\nThis parameter can be used only when the `q` query string parameter is specified.", + "description": "The default operator for query string query: `and` or `or`.\nThis parameter can be used only when the `q` query string parameter is specified.", "deprecated": false, "schema": { "$ref": "#/components/schemas/_types.query_dsl.Operator" @@ -138985,7 +138984,7 @@ "indices.validate_query-default_operator": { "in": "query", "name": "default_operator", - "description": "The default operator for query string query: `AND` or `OR`.", + "description": "The default operator for query string query: `and` or `or`.", "deprecated": false, "schema": { "$ref": "#/components/schemas/_types.query_dsl.Operator" @@ -141484,7 +141483,7 @@ "search-default_operator": { "in": "query", "name": "default_operator", - "description": "The default operator for the query string query: `AND` or `OR`.\nThis parameter can be used only when the `q` query string parameter is specified.", + "description": "The default operator for the query string query: `and` or `or`.\nThis parameter can be used only when the `q` query string parameter is specified.", "deprecated": false, "schema": { "$ref": "#/components/schemas/_types.query_dsl.Operator" diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index a26c2651a9..e027b2365b 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -4979,7 +4979,7 @@ { "in": "query", "name": "default_operator", - "description": "The default operator for query string query: `AND` or `OR`.\nThis parameter can be used only when the `q` query string parameter is specified.", + "description": "The default operator for query string query: `and` or `or`.\nThis parameter can be used only when the `q` query string parameter is specified.", "deprecated": false, "schema": { "$ref": "#/components/schemas/_types.query_dsl.Operator" @@ -27987,7 +27987,7 @@ { "in": "query", "name": "default_operator", - "description": "The default operator for query string query: `AND` or `OR`.\nThis parameter can be used only when the `q` query string parameter is specified.", + "description": "The default operator for query string query: `and` or `or`.\nThis parameter can be used only when the `q` query string parameter is specified.", "deprecated": false, "schema": { "$ref": "#/components/schemas/_types.query_dsl.Operator" @@ -39109,8 +39109,7 @@ "enum": [ "internal", "external", - "external_gte", - "force" + "external_gte" ] }, "_types.analysis.StopWords": { @@ -82023,7 +82022,7 @@ "count-default_operator": { "in": "query", "name": "default_operator", - "description": "The default operator for query string query: `AND` or `OR`.\nThis parameter can be used only when the `q` query string parameter is specified.", + "description": "The default operator for query string query: `and` or `or`.\nThis parameter can be used only when the `q` query string parameter is specified.", "deprecated": false, "schema": { "$ref": "#/components/schemas/_types.query_dsl.Operator" @@ -82419,7 +82418,7 @@ "explain-default_operator": { "in": "query", "name": "default_operator", - "description": "The default operator for query string query: `AND` or `OR`.\nThis parameter can be used only when the `q` query string parameter is specified.", + "description": "The default operator for query string query: `and` or `or`.\nThis parameter can be used only when the `q` query string parameter is specified.", "deprecated": false, "schema": { "$ref": "#/components/schemas/_types.query_dsl.Operator" @@ -83776,7 +83775,7 @@ "indices.validate_query-default_operator": { "in": "query", "name": "default_operator", - "description": "The default operator for query string query: `AND` or `OR`.", + "description": "The default operator for query string query: `and` or `or`.", "deprecated": false, "schema": { "$ref": "#/components/schemas/_types.query_dsl.Operator" @@ -85271,7 +85270,7 @@ "search-default_operator": { "in": "query", "name": "default_operator", - "description": "The default operator for the query string query: `AND` or `OR`.\nThis parameter can be used only when the `q` query string parameter is specified.", + "description": "The default operator for the query string query: `and` or `or`.\nThis parameter can be used only when the `q` query string parameter is specified.", "deprecated": false, "schema": { "$ref": "#/components/schemas/_types.query_dsl.Operator" diff --git a/output/schema/schema.json b/output/schema/schema.json index 90664b01d5..dbd96dc11a 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -25441,10 +25441,10 @@ } }, { - "description": "The default operator for query string query: `AND` or `OR`.\nThis parameter can be used only when the `q` query string parameter is specified.", + "description": "The default operator for query string query: `and` or `or`.\nThis parameter can be used only when the `q` query string parameter is specified.", "name": "default_operator", "required": false, - "serverDefault": "OR", + "serverDefault": "or", "type": { "kind": "instance_of", "type": { @@ -26374,10 +26374,10 @@ } }, { - "description": "The default operator for query string query: `AND` or `OR`.\nThis parameter can be used only when the `q` query string parameter is specified.", + "description": "The default operator for query string query: `and` or `or`.\nThis parameter can be used only when the `q` query string parameter is specified.", "name": "default_operator", "required": false, - "serverDefault": "OR", + "serverDefault": "or", "type": { "kind": "instance_of", "type": { @@ -27776,10 +27776,10 @@ } }, { - "description": "The default operator for query string query: `AND` or `OR`.\nThis parameter can be used only when the `q` query string parameter is specified.", + "description": "The default operator for query string query: `and` or `or`.\nThis parameter can be used only when the `q` query string parameter is specified.", "name": "default_operator", "required": false, - "serverDefault": "OR", + "serverDefault": "or", "type": { "kind": "instance_of", "type": { @@ -38612,10 +38612,10 @@ } }, { - "description": "The default operator for the query string query: `AND` or `OR`.\nThis parameter can be used only when the `q` query string parameter is specified.", + "description": "The default operator for the query string query: `and` or `or`.\nThis parameter can be used only when the `q` query string parameter is specified.", "name": "default_operator", "required": false, - "serverDefault": "OR", + "serverDefault": "or", "type": { "kind": "instance_of", "type": { @@ -48658,10 +48658,10 @@ } }, { - "description": "The default operator for query string query: `AND` or `OR`.\nThis parameter can be used only when the `q` query string parameter is specified.", + "description": "The default operator for query string query: `and` or `or`.\nThis parameter can be used only when the `q` query string parameter is specified.", "name": "default_operator", "required": false, - "serverDefault": "OR", + "serverDefault": "or", "type": { "kind": "instance_of", "type": { @@ -49639,7 +49639,7 @@ "name": "AggregateName", "namespace": "_types" }, - "specLocation": "_types/common.ts#L149-L153", + "specLocation": "_types/common.ts#L145-L149", "type": { "kind": "instance_of", "type": { @@ -49890,7 +49890,7 @@ "name": "Bytes", "namespace": "_types" }, - "specLocation": "_types/common.ts#L173-L185" + "specLocation": "_types/common.ts#L169-L181" }, { "kind": "interface", @@ -50065,7 +50065,7 @@ "name": "ClusterInfoTarget", "namespace": "_types" }, - "specLocation": "_types/common.ts#L387-L393" + "specLocation": "_types/common.ts#L383-L389" }, { "kind": "type_alias", @@ -50073,7 +50073,7 @@ "name": "ClusterInfoTargets", "namespace": "_types" }, - "specLocation": "_types/common.ts#L395-L395", + "specLocation": "_types/common.ts#L391-L391", "type": { "kind": "union_of", "items": [ @@ -50292,7 +50292,7 @@ "name": "Conflicts", "namespace": "_types" }, - "specLocation": "_types/common.ts#L187-L196" + "specLocation": "_types/common.ts#L183-L192" }, { "kind": "interface", @@ -50903,7 +50903,7 @@ "namespace": "_types" }, "properties": [], - "specLocation": "_types/common.ts#L164-L165" + "specLocation": "_types/common.ts#L160-L161" }, { "kind": "type_alias", @@ -51112,7 +51112,7 @@ "name": "ExpandWildcard", "namespace": "_types" }, - "specLocation": "_types/common.ts#L205-L219" + "specLocation": "_types/common.ts#L201-L215" }, { "kind": "type_alias", @@ -51120,7 +51120,7 @@ "name": "ExpandWildcards", "namespace": "_types" }, - "specLocation": "_types/common.ts#L221-L221", + "specLocation": "_types/common.ts#L217-L217", "type": { "kind": "union_of", "items": [ @@ -51151,7 +51151,7 @@ "name": "Field", "namespace": "_types" }, - "specLocation": "_types/common.ts#L142-L143", + "specLocation": "_types/common.ts#L138-L139", "type": { "kind": "instance_of", "type": { @@ -51476,7 +51476,7 @@ "name": "Fields", "namespace": "_types" }, - "specLocation": "_types/common.ts#L144-L144", + "specLocation": "_types/common.ts#L140-L140", "type": { "kind": "union_of", "items": [ @@ -51571,7 +51571,7 @@ "name": "Fuzziness", "namespace": "_types" }, - "specLocation": "_types/common.ts#L137-L138", + "specLocation": "_types/common.ts#L133-L134", "type": { "kind": "union_of", "items": [ @@ -52319,7 +52319,7 @@ "name": "HealthStatus", "namespace": "_types" }, - "specLocation": "_types/common.ts#L223-L245" + "specLocation": "_types/common.ts#L219-L241" }, { "kind": "type_alias", @@ -52342,7 +52342,7 @@ "name": "HttpHeaders", "namespace": "_types" }, - "specLocation": "_types/common.ts#L162-L162", + "specLocation": "_types/common.ts#L158-L158", "type": { "kind": "dictionary_of", "key": { @@ -52819,7 +52819,7 @@ } } ], - "specLocation": "_types/common.ts#L341-L368" + "specLocation": "_types/common.ts#L337-L364" }, { "kind": "interface", @@ -52962,7 +52962,7 @@ } } ], - "specLocation": "_types/common.ts#L326-L339" + "specLocation": "_types/common.ts#L322-L335" }, { "kind": "interface", @@ -53476,7 +53476,7 @@ "name": "Level", "namespace": "_types" }, - "specLocation": "_types/common.ts#L255-L259" + "specLocation": "_types/common.ts#L251-L255" }, { "kind": "enum", @@ -53864,7 +53864,7 @@ "name": "MinimumShouldMatch", "namespace": "_types" }, - "specLocation": "_types/common.ts#L167-L171", + "specLocation": "_types/common.ts#L163-L167", "type": { "kind": "union_of", "items": [ @@ -53893,7 +53893,7 @@ "name": "MultiTermQueryRewrite", "namespace": "_types" }, - "specLocation": "_types/common.ts#L139-L140", + "specLocation": "_types/common.ts#L135-L136", "type": { "kind": "instance_of", "type": { @@ -54487,7 +54487,7 @@ "name": "OpType", "namespace": "_types" }, - "specLocation": "_types/common.ts#L261-L270" + "specLocation": "_types/common.ts#L257-L266" }, { "kind": "type_alias", @@ -54495,7 +54495,7 @@ "name": "Password", "namespace": "_types" }, - "specLocation": "_types/common.ts#L199-L199", + "specLocation": "_types/common.ts#L195-L195", "type": { "kind": "instance_of", "type": { @@ -54731,7 +54731,7 @@ "name": "PropertyName", "namespace": "_types" }, - "specLocation": "_types/common.ts#L134-L134", + "specLocation": "_types/common.ts#L130-L130", "type": { "kind": "instance_of", "type": { @@ -55083,7 +55083,7 @@ "name": "Refresh", "namespace": "_types" }, - "specLocation": "_types/common.ts#L272-L279" + "specLocation": "_types/common.ts#L268-L275" }, { "kind": "interface", @@ -55185,7 +55185,7 @@ "name": "RelationName", "namespace": "_types" }, - "specLocation": "_types/common.ts#L135-L135", + "specLocation": "_types/common.ts#L131-L131", "type": { "kind": "instance_of", "type": { @@ -56474,7 +56474,7 @@ "name": "SearchType", "namespace": "_types" }, - "specLocation": "_types/common.ts#L281-L286" + "specLocation": "_types/common.ts#L277-L282" }, { "kind": "interface", @@ -56779,7 +56779,7 @@ "name": "SequenceNumber", "namespace": "_types" }, - "specLocation": "_types/common.ts#L132-L132", + "specLocation": "_types/common.ts#L128-L128", "type": { "kind": "instance_of", "type": { @@ -57034,7 +57034,7 @@ "name": "Slices", "namespace": "_types" }, - "specLocation": "_types/common.ts#L370-L375", + "specLocation": "_types/common.ts#L366-L371", "type": { "kind": "union_of", "items": [ @@ -57067,7 +57067,7 @@ "name": "SlicesCalculation", "namespace": "_types" }, - "specLocation": "_types/common.ts#L377-L385" + "specLocation": "_types/common.ts#L373-L381" }, { "kind": "type_alias", @@ -57562,7 +57562,7 @@ "name": "SuggestMode", "namespace": "_types" }, - "specLocation": "_types/common.ts#L288-L301" + "specLocation": "_types/common.ts#L284-L297" }, { "kind": "type_alias", @@ -57571,7 +57571,7 @@ "name": "SuggestionName", "namespace": "_types" }, - "specLocation": "_types/common.ts#L155-L159", + "specLocation": "_types/common.ts#L151-L155", "type": { "kind": "instance_of", "type": { @@ -57640,7 +57640,7 @@ "name": "TaskId", "namespace": "_types" }, - "specLocation": "_types/common.ts#L136-L136", + "specLocation": "_types/common.ts#L132-L132", "type": { "kind": "union_of", "items": [ @@ -57799,7 +57799,7 @@ "name": "ThreadType", "namespace": "_types" }, - "specLocation": "_types/common.ts#L303-L309" + "specLocation": "_types/common.ts#L299-L305" }, { "kind": "type_alias", @@ -58204,7 +58204,7 @@ "name": "Username", "namespace": "_types" }, - "specLocation": "_types/common.ts#L198-L198", + "specLocation": "_types/common.ts#L194-L194", "type": { "kind": "instance_of", "type": { @@ -58219,7 +58219,7 @@ "name": "Uuid", "namespace": "_types" }, - "specLocation": "_types/common.ts#L129-L129", + "specLocation": "_types/common.ts#L125-L125", "type": { "kind": "instance_of", "type": { @@ -58272,17 +58272,13 @@ { "description": "Only index the document if the specified version is equal or higher than the version of the stored document or if there is no existing document.\nNOTE: The `external_gte` version type is meant for special use cases and should be used with care.\nIf used incorrectly, it can result in loss of data.", "name": "external_gte" - }, - { - "description": "This option is deprecated because it can cause primary and replica shards to diverge.", - "name": "force" } ], "name": { "name": "VersionType", "namespace": "_types" }, - "specLocation": "_types/common.ts#L107-L126" + "specLocation": "_types/common.ts#L107-L122" }, { "kind": "enum", @@ -58298,7 +58294,7 @@ "name": "WaitForActiveShardOptions", "namespace": "_types" }, - "specLocation": "_types/common.ts#L311-L315" + "specLocation": "_types/common.ts#L307-L311" }, { "kind": "type_alias", @@ -58310,7 +58306,7 @@ "name": "WaitForActiveShards", "namespace": "_types" }, - "specLocation": "_types/common.ts#L146-L147", + "specLocation": "_types/common.ts#L142-L143", "type": { "kind": "union_of", "items": [ @@ -58357,7 +58353,7 @@ "name": "WaitForEvents", "namespace": "_types" }, - "specLocation": "_types/common.ts#L317-L324" + "specLocation": "_types/common.ts#L313-L320" }, { "kind": "interface", @@ -165964,10 +165960,10 @@ } }, { - "description": "The default operator for query string query: `AND` or `OR`.", + "description": "The default operator for query string query: `and` or `or`.", "name": "default_operator", "required": false, - "serverDefault": "OR", + "serverDefault": "or", "type": { "kind": "instance_of", "type": { @@ -255227,7 +255223,7 @@ "type": { "kind": "instance_of", "type": { - "name": "TimeUnit", + "name": "Duration", "namespace": "_types" } } diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 88ad2f388b..c081d1d4d1 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -3077,7 +3077,7 @@ export type VersionNumber = long export type VersionString = string -export type VersionType = 'internal' | 'external' | 'external_gte' | 'force' +export type VersionType = 'internal' | 'external' | 'external_gte' export type WaitForActiveShardOptions = 'all' | 'index-setting' @@ -21843,7 +21843,7 @@ export interface StreamsStatusLogsStatus { } export interface StreamsStatusRequest extends RequestBase { - master_timeout?: TimeUnit + master_timeout?: Duration } export interface StreamsStatusResponse { diff --git a/specification/_global/count/CountRequest.ts b/specification/_global/count/CountRequest.ts index d2ad039062..0837919f24 100644 --- a/specification/_global/count/CountRequest.ts +++ b/specification/_global/count/CountRequest.ts @@ -81,9 +81,9 @@ export interface Request extends RequestBase { */ analyze_wildcard?: boolean /** - * The default operator for query string query: `AND` or `OR`. + * The default operator for query string query: `and` or `or`. * This parameter can be used only when the `q` query string parameter is specified. - * @server_default OR + * @server_default or */ default_operator?: Operator /** diff --git a/specification/_global/delete_by_query/DeleteByQueryRequest.ts b/specification/_global/delete_by_query/DeleteByQueryRequest.ts index 7d21c9abfe..d4ab25e95f 100644 --- a/specification/_global/delete_by_query/DeleteByQueryRequest.ts +++ b/specification/_global/delete_by_query/DeleteByQueryRequest.ts @@ -162,9 +162,9 @@ export interface Request extends RequestBase { */ conflicts?: Conflicts /** - * The default operator for query string query: `AND` or `OR`. + * The default operator for query string query: `and` or `or`. * This parameter can be used only when the `q` query string parameter is specified. - * @server_default OR + * @server_default or */ default_operator?: Operator /** diff --git a/specification/_global/explain/ExplainRequest.ts b/specification/_global/explain/ExplainRequest.ts index efa9fbe657..3e44fc21df 100644 --- a/specification/_global/explain/ExplainRequest.ts +++ b/specification/_global/explain/ExplainRequest.ts @@ -65,9 +65,9 @@ export interface Request extends RequestBase { */ analyze_wildcard?: boolean /** - * The default operator for query string query: `AND` or `OR`. + * The default operator for query string query: `and` or `or`. * This parameter can be used only when the `q` query string parameter is specified. - * @server_default OR + * @server_default or */ default_operator?: Operator /** diff --git a/specification/_global/search/SearchRequest.ts b/specification/_global/search/SearchRequest.ts index e0cbdcfe5e..fc7d9cfa6b 100644 --- a/specification/_global/search/SearchRequest.ts +++ b/specification/_global/search/SearchRequest.ts @@ -138,9 +138,9 @@ export interface Request extends RequestBase { */ ccs_minimize_roundtrips?: boolean /** - * The default operator for the query string query: `AND` or `OR`. + * The default operator for the query string query: `and` or `or`. * This parameter can be used only when the `q` query string parameter is specified. - * @server_default OR + * @server_default or */ default_operator?: Operator /** diff --git a/specification/_global/update_by_query/UpdateByQueryRequest.ts b/specification/_global/update_by_query/UpdateByQueryRequest.ts index 819125bd15..251593995e 100644 --- a/specification/_global/update_by_query/UpdateByQueryRequest.ts +++ b/specification/_global/update_by_query/UpdateByQueryRequest.ts @@ -166,9 +166,9 @@ export interface Request extends RequestBase { */ conflicts?: Conflicts /** - * The default operator for query string query: `AND` or `OR`. + * The default operator for query string query: `and` or `or`. * This parameter can be used only when the `q` query string parameter is specified. - * @server_default OR + * @server_default or */ default_operator?: Operator /** diff --git a/specification/_types/common.ts b/specification/_types/common.ts index 94d2238b13..5730f63b55 100644 --- a/specification/_types/common.ts +++ b/specification/_types/common.ts @@ -118,11 +118,7 @@ export enum VersionType { * NOTE: The `external_gte` version type is meant for special use cases and should be used with care. * If used incorrectly, it can result in loss of data. */ - external_gte, - /** - * This option is deprecated because it can cause primary and replica shards to diverge. - */ - force + external_gte } // TODO: replace all uuid's with this type diff --git a/specification/indices/validate_query/IndicesValidateQueryRequest.ts b/specification/indices/validate_query/IndicesValidateQueryRequest.ts index be4308f114..b9cbfbba8b 100644 --- a/specification/indices/validate_query/IndicesValidateQueryRequest.ts +++ b/specification/indices/validate_query/IndicesValidateQueryRequest.ts @@ -72,8 +72,8 @@ export interface Request extends RequestBase { */ analyze_wildcard?: boolean /** - * The default operator for query string query: `AND` or `OR`. - * @server_default OR + * The default operator for query string query: `and` or `or`. + * @server_default or */ default_operator?: Operator /** diff --git a/specification/streams/status/StreamsStatusRequest.ts b/specification/streams/status/StreamsStatusRequest.ts index e3877e030c..76c748fa39 100644 --- a/specification/streams/status/StreamsStatusRequest.ts +++ b/specification/streams/status/StreamsStatusRequest.ts @@ -18,7 +18,7 @@ */ import { RequestBase } from '@_types/Base' -import { TimeUnit } from '@_types/Time' +import { Duration } from '@_types/Time' /** * Get the status of streams. @@ -42,6 +42,6 @@ export interface Request extends RequestBase { * * @server_default 30s */ - master_timeout?: TimeUnit + master_timeout?: Duration } }