From 3b1143a5a96fc7596af96485bccca492798d6f0e Mon Sep 17 00:00:00 2001 From: Laura Trotta <153528055+l-trotta@users.noreply.github.com> Date: Tue, 1 Oct 2024 18:16:02 +0200 Subject: [PATCH] Java issues batch 8 (#2959) * [877] ngram and edge tokenizer optional values * [880] _shards optional because of wait_for_completion * [881] added missing allow_custom_routing * [883] action and name optional next_step * both steps mandatory in move to step request --- output/openapi/elasticsearch-openapi.json | 24 ++++++------- .../elasticsearch-serverless-openapi.json | 16 ++++----- output/schema/schema-serverless.json | 25 +++++++++---- output/schema/schema.json | 35 ++++++++++++------- output/typescript/types.ts | 19 +++++----- specification/_types/Base.ts | 3 +- specification/_types/analysis/tokenizers.ts | 8 ++--- .../ilm/move_to_step/MoveToStepRequest.ts | 4 +-- specification/ilm/move_to_step/types.ts | 5 +-- specification/indices/_types/DataStream.ts | 1 + 10 files changed, 80 insertions(+), 60 deletions(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 2bfca7e4ec..f41dad17f2 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -9643,7 +9643,11 @@ "next_step": { "$ref": "#/components/schemas/ilm.move_to_step:StepKey" } - } + }, + "required": [ + "current_step", + "next_step" + ] } } } @@ -57499,9 +57503,7 @@ } }, "required": [ - "type", - "max_gram", - "min_gram" + "type" ] } ] @@ -57614,9 +57616,7 @@ } }, "required": [ - "type", - "max_gram", - "min_gram" + "type" ] } ] @@ -66532,8 +66532,6 @@ } }, "required": [ - "action", - "name", "phase" ] }, @@ -66742,10 +66740,7 @@ "_shards": { "$ref": "#/components/schemas/_types:ShardStatistics" } - }, - "required": [ - "_shards" - ] + } }, "indices.close:CloseIndexResult": { "type": "object", @@ -67320,6 +67315,9 @@ "properties": { "hidden": { "type": "boolean" + }, + "allow_custom_routing": { + "type": "boolean" } } }, diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index 1eb75e6ebf..388d5295c2 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -39244,9 +39244,7 @@ } }, "required": [ - "type", - "max_gram", - "min_gram" + "type" ] } ] @@ -39359,9 +39357,7 @@ } }, "required": [ - "type", - "max_gram", - "min_gram" + "type" ] } ] @@ -45335,6 +45331,9 @@ "properties": { "hidden": { "type": "boolean" + }, + "allow_custom_routing": { + "type": "boolean" } } }, @@ -45344,10 +45343,7 @@ "_shards": { "$ref": "#/components/schemas/_types:ShardStatistics" } - }, - "required": [ - "_shards" - ] + } }, "indices.resolve_index:ResolveIndexItem": { "type": "object", diff --git a/output/schema/schema-serverless.json b/output/schema/schema-serverless.json index aabc06715e..5d16a18f16 100644 --- a/output/schema/schema-serverless.json +++ b/output/schema/schema-serverless.json @@ -84773,7 +84773,7 @@ }, { "name": "max_gram", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -84784,7 +84784,7 @@ }, { "name": "min_gram", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -84929,7 +84929,7 @@ }, { "name": "max_gram", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -84940,7 +84940,7 @@ }, { "name": "min_gram", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -119103,9 +119103,20 @@ "namespace": "_builtins" } } + }, + { + "name": "allow_custom_routing", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } } ], - "specLocation": "indices/_types/DataStream.ts#L159-L161" + "specLocation": "indices/_types/DataStream.ts#L159-L162" }, { "kind": "interface", @@ -119116,7 +119127,7 @@ "properties": [ { "name": "_shards", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -119126,7 +119137,7 @@ } } ], - "specLocation": "_types/Base.ts#L91-L93" + "specLocation": "_types/Base.ts#L91-L94" }, { "kind": "interface", diff --git a/output/schema/schema.json b/output/schema/schema.json index a9561dd039..7444903b33 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -48904,7 +48904,7 @@ "properties": [ { "name": "_shards", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -48914,7 +48914,7 @@ } } ], - "specLocation": "_types/Base.ts#L91-L93" + "specLocation": "_types/Base.ts#L91-L94" }, { "kind": "interface", @@ -65408,7 +65408,7 @@ }, { "name": "max_gram", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -65419,7 +65419,7 @@ }, { "name": "min_gram", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -68231,7 +68231,7 @@ }, { "name": "max_gram", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -68242,7 +68242,7 @@ }, { "name": "min_gram", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -121442,7 +121442,7 @@ "properties": [ { "name": "current_step", - "required": false, + "required": true, "type": { "kind": "instance_of", "type": { @@ -121453,7 +121453,7 @@ }, { "name": "next_step", - "required": false, + "required": true, "type": { "kind": "instance_of", "type": { @@ -121519,7 +121519,7 @@ "properties": [ { "name": "action", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -121530,7 +121530,7 @@ }, { "name": "name", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -121551,7 +121551,7 @@ } } ], - "specLocation": "ilm/move_to_step/types.ts#L20-L24" + "specLocation": "ilm/move_to_step/types.ts#L20-L25" }, { "kind": "request", @@ -122667,9 +122667,20 @@ "namespace": "_builtins" } } + }, + { + "name": "allow_custom_routing", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } } ], - "specLocation": "indices/_types/DataStream.ts#L159-L161" + "specLocation": "indices/_types/DataStream.ts#L159-L162" }, { "kind": "interface", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index bb9645c9ba..c5515b39f6 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -2830,7 +2830,7 @@ export interface ShardStatistics { } export interface ShardsOperationResponseBase { - _shards: ShardStatistics + _shards?: ShardStatistics } export interface SlicedScroll { @@ -4590,8 +4590,8 @@ export interface AnalysisEdgeNGramTokenFilter extends AnalysisTokenFilterBase { export interface AnalysisEdgeNGramTokenizer extends AnalysisTokenizerBase { type: 'edge_ngram' custom_token_chars?: string - max_gram: integer - min_gram: integer + max_gram?: integer + min_gram?: integer token_chars?: AnalysisTokenChar[] } @@ -4933,8 +4933,8 @@ export interface AnalysisNGramTokenFilter extends AnalysisTokenFilterBase { export interface AnalysisNGramTokenizer extends AnalysisTokenizerBase { type: 'ngram' custom_token_chars?: string - max_gram: integer - min_gram: integer + max_gram?: integer + min_gram?: integer token_chars?: AnalysisTokenChar[] } @@ -10775,16 +10775,16 @@ export interface IlmMigrateToDataTiersResponse { export interface IlmMoveToStepRequest extends RequestBase { index: IndexName body?: { - current_step?: IlmMoveToStepStepKey - next_step?: IlmMoveToStepStepKey + current_step: IlmMoveToStepStepKey + next_step: IlmMoveToStepStepKey } } export type IlmMoveToStepResponse = AcknowledgedResponseBase export interface IlmMoveToStepStepKey { - action: string - name: string + action?: string + name?: string phase: string } @@ -10912,6 +10912,7 @@ export interface IndicesDataStreamTimestampField { export interface IndicesDataStreamVisibility { hidden?: boolean + allow_custom_routing?: boolean } export interface IndicesDownsampleConfig { diff --git a/specification/_types/Base.ts b/specification/_types/Base.ts index 2ac27fe0c5..383dab96b3 100644 --- a/specification/_types/Base.ts +++ b/specification/_types/Base.ts @@ -89,7 +89,8 @@ export class IndicesResponseBase extends AcknowledgedResponseBase { } export class ShardsOperationResponseBase { - _shards: ShardStatistics + // _shards is always returned, but not when wait_for_completion is false in the request + _shards?: ShardStatistics } export class CustomResponseBuilderBase {} diff --git a/specification/_types/analysis/tokenizers.ts b/specification/_types/analysis/tokenizers.ts index 948149aaeb..31086cbda2 100644 --- a/specification/_types/analysis/tokenizers.ts +++ b/specification/_types/analysis/tokenizers.ts @@ -48,8 +48,8 @@ export class ClassicTokenizer extends TokenizerBase { export class EdgeNGramTokenizer extends TokenizerBase { type: 'edge_ngram' custom_token_chars?: string - max_gram: integer - min_gram: integer + max_gram?: integer + min_gram?: integer /** * @server_default [] */ @@ -84,8 +84,8 @@ export class LowercaseTokenizer extends TokenizerBase { export class NGramTokenizer extends TokenizerBase { type: 'ngram' custom_token_chars?: string - max_gram: integer - min_gram: integer + max_gram?: integer + min_gram?: integer /** * @server_default [] */ diff --git a/specification/ilm/move_to_step/MoveToStepRequest.ts b/specification/ilm/move_to_step/MoveToStepRequest.ts index 3005e5f99b..d2d5f305ea 100644 --- a/specification/ilm/move_to_step/MoveToStepRequest.ts +++ b/specification/ilm/move_to_step/MoveToStepRequest.ts @@ -30,7 +30,7 @@ export interface Request extends RequestBase { index: IndexName } body: { - current_step?: StepKey - next_step?: StepKey + current_step: StepKey + next_step: StepKey } } diff --git a/specification/ilm/move_to_step/types.ts b/specification/ilm/move_to_step/types.ts index 01d8fca691..f15c0df8fd 100644 --- a/specification/ilm/move_to_step/types.ts +++ b/specification/ilm/move_to_step/types.ts @@ -18,7 +18,8 @@ */ export class StepKey { - action: string - name: string + // action and name are optional in case they are used in next_step + action?: string + name?: string phase: string } diff --git a/specification/indices/_types/DataStream.ts b/specification/indices/_types/DataStream.ts index 73c47d95c6..b416ef5383 100644 --- a/specification/indices/_types/DataStream.ts +++ b/specification/indices/_types/DataStream.ts @@ -158,4 +158,5 @@ export class DataStreamIndex { export class DataStreamVisibility { hidden?: boolean + allow_custom_routing?: boolean }