From 8b6dbe25675c9fe5315bbb9ef470aff2bd6723bb Mon Sep 17 00:00:00 2001 From: Sylvain Wallez Date: Wed, 22 May 2024 18:53:26 +0200 Subject: [PATCH 1/2] Remove ES|QL version --- compiler/src/steps/validate-model.ts | 3 - .../elasticsearch-serverless-openapi.json | 12 +--- output/schema/schema.json | 55 +------------------ output/typescript/types.ts | 7 --- specification/esql/_types/EsqlVersion.ts | 48 ---------------- specification/esql/query/QueryRequest.ts | 5 -- 6 files changed, 2 insertions(+), 128 deletions(-) delete mode 100644 specification/esql/_types/EsqlVersion.ts diff --git a/compiler/src/steps/validate-model.ts b/compiler/src/steps/validate-model.ts index 4e661ac94f..7f28d15652 100644 --- a/compiler/src/steps/validate-model.ts +++ b/compiler/src/steps/validate-model.ts @@ -174,9 +174,6 @@ export default async function validateModel (apiModel: model.Model, restSpec: Ma const additionalRoots: TypeName[] = [ // ErrorResponse is not referenced anywhere, but any API could return it if an error happens. { namespace: '_types', name: 'ErrorResponseBase' }, - // ESQL base versions are pseudo-constants - { namespace: 'esql._types', name: 'BaseStatefulEsqlVersion' }, - { namespace: 'esql._types', name: 'BaseServerlessEsqlVersion' } ] additionalRoots.forEach(t => validateTypeRef(t, undefined, new Set())) diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index f5920a514d..c0707fdf17 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -5474,14 +5474,10 @@ "query": { "description": "The ES|QL query API accepts an ES|QL query string in the query parameter, runs it, and returns the results.", "type": "string" - }, - "version": { - "$ref": "#/components/schemas/esql._types:EsqlVersion" } }, "required": [ - "query", - "version" + "query" ] } } @@ -51434,12 +51430,6 @@ "head" ] }, - "esql._types:EsqlVersion": { - "type": "string", - "enum": [ - "2024.04.01" - ] - }, "_types:EsqlColumns": { "type": "object" }, diff --git a/output/schema/schema.json b/output/schema/schema.json index 54a9233d3a..30e4bad992 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -112674,47 +112674,6 @@ }, "specLocation": "eql/search/types.ts#L20-L32" }, - { - "description": "Version of the ES|QL language that should be used by default in serverless client libraries.\n\nThis value is guaranteed to be stable for a given value of the Serverless API version, even if newer versions\nof the ES|QL language are added within that API version.", - "kind": "type_alias", - "name": { - "name": "BaseServerlessEsqlVersion", - "namespace": "esql._types" - }, - "specLocation": "esql/_types/EsqlVersion.ts#L42-L48", - "type": { - "kind": "literal_value", - "value": "2024.04.01" - } - }, - { - "description": "Version of the ES|QL language that should be used by default in stateful client libraries.\n\nThis value is guaranteed to be stable within a major version of the Elastic Stack, even if newer versions\nof the ES|QL language are added within that major version.", - "kind": "type_alias", - "name": { - "name": "BaseStatefulEsqlVersion", - "namespace": "esql._types" - }, - "specLocation": "esql/_types/EsqlVersion.ts#L34-L40", - "type": { - "kind": "literal_value", - "value": "2024.04.01" - } - }, - { - "kind": "enum", - "members": [ - { - "codegenName": "V2024_04_01", - "description": "Run against the first version of ES|QL.", - "name": "2024.04.01" - } - ], - "name": { - "name": "EsqlVersion", - "namespace": "esql._types" - }, - "specLocation": "esql/_types/EsqlVersion.ts#L20-L29" - }, { "attachedBehaviors": [ "CommonQueryParameters" @@ -112785,18 +112744,6 @@ "namespace": "_builtins" } } - }, - { - "description": "The version of the ES|QL language in which the \"query\" field was written.", - "name": "version", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "EsqlVersion", - "namespace": "esql._types" - } - } } ] }, @@ -112839,7 +112786,7 @@ } } ], - "specLocation": "esql/query/QueryRequest.ts#L25-L70" + "specLocation": "esql/query/QueryRequest.ts#L24-L65" }, { "body": { diff --git a/output/typescript/types.ts b/output/typescript/types.ts index f3db8d34c3..e404574c7f 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -9836,12 +9836,6 @@ export type EqlSearchResponse = EqlEqlSearchResponseBase Date: Wed, 22 May 2024 19:04:16 +0200 Subject: [PATCH 2/2] Make linter happy --- compiler/src/steps/validate-model.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/src/steps/validate-model.ts b/compiler/src/steps/validate-model.ts index 7f28d15652..fa3fd581cf 100644 --- a/compiler/src/steps/validate-model.ts +++ b/compiler/src/steps/validate-model.ts @@ -173,7 +173,7 @@ export default async function validateModel (apiModel: model.Model, restSpec: Ma const additionalRoots: TypeName[] = [ // ErrorResponse is not referenced anywhere, but any API could return it if an error happens. - { namespace: '_types', name: 'ErrorResponseBase' }, + { namespace: '_types', name: 'ErrorResponseBase' } ] additionalRoots.forEach(t => validateTypeRef(t, undefined, new Set()))