From bd30a4fb3a4acd9bffaeeb5e6c95d3e5d121dc75 Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Fri, 27 Sep 2024 11:29:04 +0400 Subject: [PATCH 1/2] Fix indices.delete_api response --- output/openapi/elasticsearch-openapi.json | 3 +++ .../elasticsearch-serverless-openapi.json | 3 +++ output/schema/schema-serverless.json | 23 ++++++++++++++--- output/schema/schema.json | 25 +++++++++++++++---- output/typescript/types.ts | 1 + specification/_types/Base.ts | 1 + 6 files changed, 47 insertions(+), 9 deletions(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index dcfce53610..cb7c503a08 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -38506,6 +38506,9 @@ "acknowledged": { "description": "For a successful response, this value is always true. On failure, an exception is returned instead.", "type": "boolean" + }, + "errors": { + "type": "boolean" } }, "required": [ diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index 26a2a464e1..6c9b4c4fc4 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -20215,6 +20215,9 @@ "acknowledged": { "description": "For a successful response, this value is always true. On failure, an exception is returned instead.", "type": "boolean" + }, + "errors": { + "type": "boolean" } }, "required": [ diff --git a/output/schema/schema-serverless.json b/output/schema/schema-serverless.json index 13998366b4..52b7b93013 100644 --- a/output/schema/schema-serverless.json +++ b/output/schema/schema-serverless.json @@ -76508,7 +76508,7 @@ } } ], - "specLocation": "_types/Base.ts#L76-L85" + "specLocation": "_types/Base.ts#L77-L86" }, { "codegenNames": [ @@ -106454,9 +106454,20 @@ "namespace": "_builtins" } } + }, + { + "name": "errors", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } } ], - "specLocation": "_types/Base.ts#L47-L50" + "specLocation": "_types/Base.ts#L47-L51" }, { "generics": [ @@ -119343,7 +119354,7 @@ } } ], - "specLocation": "_types/Base.ts#L87-L89" + "specLocation": "_types/Base.ts#L88-L90" }, { "kind": "interface", @@ -120430,7 +120441,11 @@ } } ], +<<<<<<< HEAD "specLocation": "_types/Base.ts#L91-L94" +======= + "specLocation": "_types/Base.ts#L92-L94" +>>>>>>> bd98e9504 (Fix indices.delete_api response) }, { "kind": "interface", @@ -121676,7 +121691,7 @@ } } ], - "specLocation": "_types/Base.ts#L54-L64" + "specLocation": "_types/Base.ts#L55-L65" }, { "kind": "interface", diff --git a/output/schema/schema.json b/output/schema/schema.json index e9db5474ac..227f588eb2 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -43604,9 +43604,20 @@ "namespace": "_builtins" } } + }, + { + "name": "errors", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } } ], - "specLocation": "_types/Base.ts#L47-L50" + "specLocation": "_types/Base.ts#L47-L51" }, { "kind": "type_alias", @@ -44758,7 +44769,7 @@ } } ], - "specLocation": "_types/Base.ts#L54-L64" + "specLocation": "_types/Base.ts#L55-L65" }, { "kind": "interface", @@ -44813,7 +44824,7 @@ } } ], - "specLocation": "_types/Base.ts#L66-L74" + "specLocation": "_types/Base.ts#L67-L75" }, { "kind": "interface", @@ -44990,7 +45001,7 @@ } } ], - "specLocation": "_types/Base.ts#L76-L85" + "specLocation": "_types/Base.ts#L77-L86" }, { "kind": "type_alias", @@ -46655,7 +46666,7 @@ } } ], - "specLocation": "_types/Base.ts#L87-L89" + "specLocation": "_types/Base.ts#L88-L90" }, { "kind": "interface", @@ -50342,7 +50353,11 @@ } } ], +<<<<<<< HEAD "specLocation": "_types/Base.ts#L91-L94" +======= + "specLocation": "_types/Base.ts#L92-L94" +>>>>>>> bd98e9504 (Fix indices.delete_api response) }, { "kind": "interface", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 451cb07d34..c06d1eabc3 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -2177,6 +2177,7 @@ export type SpecUtilsWithNullValue = T | SpecUtilsNullValue export interface AcknowledgedResponseBase { acknowledged: boolean + errors?: boolean } export type AggregateName = string diff --git a/specification/_types/Base.ts b/specification/_types/Base.ts index 383dab96b3..26f7909f07 100644 --- a/specification/_types/Base.ts +++ b/specification/_types/Base.ts @@ -47,6 +47,7 @@ export class WriteResponseBase { export class AcknowledgedResponseBase { /** For a successful response, this value is always true. On failure, an exception is returned instead. */ acknowledged: boolean + errors?: boolean } export class DynamicResponseBase {} From 237cf4cf29cafb50340028b2f9695b74715d234f Mon Sep 17 00:00:00 2001 From: Laura Trotta Date: Wed, 8 Jan 2025 18:06:40 +0100 Subject: [PATCH 2/2] specific ack response for indices delete alias --- output/openapi/elasticsearch-openapi.json | 20 +++++-- .../elasticsearch-serverless-openapi.json | 20 +++++-- output/schema/schema-serverless.json | 54 +++++++++++------- output/schema/schema.json | 56 +++++++++++-------- output/typescript/types.ts | 7 ++- specification/_types/Base.ts | 1 - .../IndicesDeleteAliasResponse.ts | 6 +- 7 files changed, 109 insertions(+), 55 deletions(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index cb7c503a08..e7ee77cc63 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -38506,9 +38506,6 @@ "acknowledged": { "description": "For a successful response, this value is always true. On failure, an exception is returned instead.", "type": "boolean" - }, - "errors": { - "type": "boolean" } }, "required": [ @@ -69682,6 +69679,21 @@ } ] }, + "indices.delete_alias:IndicesAliasesResponseBody": { + "allOf": [ + { + "$ref": "#/components/schemas/_types:AcknowledgedResponseBase" + }, + { + "type": "object", + "properties": { + "errors": { + "type": "boolean" + } + } + } + ] + }, "_types:DataStreamNames": { "oneOf": [ { @@ -92850,7 +92862,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/_types:AcknowledgedResponseBase" + "$ref": "#/components/schemas/indices.delete_alias:IndicesAliasesResponseBody" } } } diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index 6c9b4c4fc4..1d806a1992 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -20215,9 +20215,6 @@ "acknowledged": { "description": "For a successful response, this value is always true. On failure, an exception is returned instead.", "type": "boolean" - }, - "errors": { - "type": "boolean" } }, "required": [ @@ -45151,6 +45148,21 @@ } ] }, + "indices.delete_alias:IndicesAliasesResponseBody": { + "allOf": [ + { + "$ref": "#/components/schemas/_types:AcknowledgedResponseBase" + }, + { + "type": "object", + "properties": { + "errors": { + "type": "boolean" + } + } + } + ] + }, "_types:DataStreamNames": { "oneOf": [ { @@ -56035,7 +56047,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/_types:AcknowledgedResponseBase" + "$ref": "#/components/schemas/indices.delete_alias:IndicesAliasesResponseBody" } } } diff --git a/output/schema/schema-serverless.json b/output/schema/schema-serverless.json index 52b7b93013..10e7dc1810 100644 --- a/output/schema/schema-serverless.json +++ b/output/schema/schema-serverless.json @@ -20778,8 +20778,8 @@ "value": { "kind": "instance_of", "type": { - "name": "AcknowledgedResponseBase", - "namespace": "_types" + "name": "IndicesAliasesResponseBody", + "namespace": "indices.delete_alias" } } }, @@ -76508,7 +76508,7 @@ } } ], - "specLocation": "_types/Base.ts#L77-L86" + "specLocation": "_types/Base.ts#L76-L85" }, { "codegenNames": [ @@ -106454,20 +106454,9 @@ "namespace": "_builtins" } } - }, - { - "name": "errors", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "boolean", - "namespace": "_builtins" - } - } } ], - "specLocation": "_types/Base.ts#L47-L51" + "specLocation": "_types/Base.ts#L47-L50" }, { "generics": [ @@ -119354,7 +119343,34 @@ } } ], - "specLocation": "_types/Base.ts#L88-L90" + "specLocation": "_types/Base.ts#L87-L89" + }, + { + "inherits": { + "type": { + "name": "AcknowledgedResponseBase", + "namespace": "_types" + } + }, + "kind": "interface", + "name": { + "name": "IndicesAliasesResponseBody", + "namespace": "indices.delete_alias" + }, + "properties": [ + { + "name": "errors", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + } + ], + "specLocation": "indices/delete_alias/IndicesDeleteAliasResponse.ts#L26-L28" }, { "kind": "interface", @@ -120441,11 +120457,7 @@ } } ], -<<<<<<< HEAD "specLocation": "_types/Base.ts#L91-L94" -======= - "specLocation": "_types/Base.ts#L92-L94" ->>>>>>> bd98e9504 (Fix indices.delete_api response) }, { "kind": "interface", @@ -121691,7 +121703,7 @@ } } ], - "specLocation": "_types/Base.ts#L55-L65" + "specLocation": "_types/Base.ts#L54-L64" }, { "kind": "interface", diff --git a/output/schema/schema.json b/output/schema/schema.json index 227f588eb2..b7b7930a17 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -43604,20 +43604,9 @@ "namespace": "_builtins" } } - }, - { - "name": "errors", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "boolean", - "namespace": "_builtins" - } - } } ], - "specLocation": "_types/Base.ts#L47-L51" + "specLocation": "_types/Base.ts#L47-L50" }, { "kind": "type_alias", @@ -44769,7 +44758,7 @@ } } ], - "specLocation": "_types/Base.ts#L55-L65" + "specLocation": "_types/Base.ts#L54-L64" }, { "kind": "interface", @@ -44824,7 +44813,7 @@ } } ], - "specLocation": "_types/Base.ts#L67-L75" + "specLocation": "_types/Base.ts#L66-L74" }, { "kind": "interface", @@ -45001,7 +44990,7 @@ } } ], - "specLocation": "_types/Base.ts#L77-L86" + "specLocation": "_types/Base.ts#L76-L85" }, { "kind": "type_alias", @@ -46666,7 +46655,7 @@ } } ], - "specLocation": "_types/Base.ts#L88-L90" + "specLocation": "_types/Base.ts#L87-L89" }, { "kind": "interface", @@ -50353,11 +50342,7 @@ } } ], -<<<<<<< HEAD "specLocation": "_types/Base.ts#L91-L94" -======= - "specLocation": "_types/Base.ts#L92-L94" ->>>>>>> bd98e9504 (Fix indices.delete_api response) }, { "kind": "interface", @@ -131542,6 +131527,33 @@ }, "specLocation": "indices/delete/IndicesDeleteResponse.ts#L22-L24" }, + { + "kind": "interface", + "inherits": { + "type": { + "name": "AcknowledgedResponseBase", + "namespace": "_types" + } + }, + "name": { + "name": "IndicesAliasesResponseBody", + "namespace": "indices.delete_alias" + }, + "properties": [ + { + "name": "errors", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + } + ], + "specLocation": "indices/delete_alias/IndicesDeleteAliasResponse.ts#L26-L28" + }, { "kind": "request", "attachedBehaviors": [ @@ -131624,8 +131636,8 @@ "value": { "kind": "instance_of", "type": { - "name": "AcknowledgedResponseBase", - "namespace": "_types" + "name": "IndicesAliasesResponseBody", + "namespace": "indices.delete_alias" } } }, diff --git a/output/typescript/types.ts b/output/typescript/types.ts index c06d1eabc3..ce3966cd51 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -2177,7 +2177,6 @@ export type SpecUtilsWithNullValue = T | SpecUtilsNullValue export interface AcknowledgedResponseBase { acknowledged: boolean - errors?: boolean } export type AggregateName = string @@ -11689,6 +11688,10 @@ export interface IndicesDeleteRequest extends RequestBase { export type IndicesDeleteResponse = IndicesResponseBase +export interface IndicesDeleteAliasIndicesAliasesResponseBody extends AcknowledgedResponseBase { + errors?: boolean +} + export interface IndicesDeleteAliasRequest extends RequestBase { index: Indices name: Names @@ -11696,7 +11699,7 @@ export interface IndicesDeleteAliasRequest extends RequestBase { timeout?: Duration } -export type IndicesDeleteAliasResponse = AcknowledgedResponseBase +export type IndicesDeleteAliasResponse = IndicesDeleteAliasIndicesAliasesResponseBody export interface IndicesDeleteDataLifecycleRequest extends RequestBase { name: DataStreamNames diff --git a/specification/_types/Base.ts b/specification/_types/Base.ts index 26f7909f07..383dab96b3 100644 --- a/specification/_types/Base.ts +++ b/specification/_types/Base.ts @@ -47,7 +47,6 @@ export class WriteResponseBase { export class AcknowledgedResponseBase { /** For a successful response, this value is always true. On failure, an exception is returned instead. */ acknowledged: boolean - errors?: boolean } export class DynamicResponseBase {} diff --git a/specification/indices/delete_alias/IndicesDeleteAliasResponse.ts b/specification/indices/delete_alias/IndicesDeleteAliasResponse.ts index 7374da4a4c..65eafa3fdb 100644 --- a/specification/indices/delete_alias/IndicesDeleteAliasResponse.ts +++ b/specification/indices/delete_alias/IndicesDeleteAliasResponse.ts @@ -20,5 +20,9 @@ import { AcknowledgedResponseBase } from '@_types/Base' export class Response { - body: AcknowledgedResponseBase + body: IndicesAliasesResponseBody +} + +export class IndicesAliasesResponseBody extends AcknowledgedResponseBase { + errors?: boolean }