From 5403ab26915a83f933365ec8c4109cec75d10612 Mon Sep 17 00:00:00 2001 From: philkra Date: Wed, 22 Dec 2021 14:56:42 +0100 Subject: [PATCH] fix msearch_template --- output/schema/schema.json | 52 ++------------------------ output/schema/validation-errors.json | 6 --- output/typescript/types.ts | 8 +--- specification/_global/msearch/types.ts | 6 +-- specification/_types/Base.ts | 2 +- 5 files changed, 7 insertions(+), 67 deletions(-) diff --git a/output/schema/schema.json b/output/schema/schema.json index 768686c9b8..a749bc6f38 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -18267,52 +18267,6 @@ "kind": "union_of" } }, - { - "generics": [ - { - "name": "TDocument", - "namespace": "_global.msearch" - } - ], - "inherits": { - "generics": [ - { - "kind": "instance_of", - "type": { - "name": "TDocument", - "namespace": "_global.msearch" - } - } - ], - "type": { - "name": "Response", - "namespace": "_global.search" - } - }, - "kind": "interface", - "name": { - "name": "MultiSearchItem", - "namespace": "_global.msearch" - }, - "properties": [ - { - "name": "status", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "integer", - "namespace": "_types" - } - } - } - ], - "specLocation": { - "endLine": 73, - "path": "_global/msearch/types.ts", - "startLine": 71 - } - }, { "generics": [ { @@ -18872,8 +18826,8 @@ ], "kind": "instance_of", "type": { - "name": "MultiSearchItem", - "namespace": "_global.msearch" + "name": "Response", + "namespace": "_global.search" } }, { @@ -32168,7 +32122,7 @@ }, { "name": "status", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { diff --git a/output/schema/validation-errors.json b/output/schema/validation-errors.json index a3aab68d15..1a1cb62645 100644 --- a/output/schema/validation-errors.json +++ b/output/schema/validation-errors.json @@ -1472,12 +1472,6 @@ ], "response": [] }, - "search": { - "request": [], - "response": [ - "Non-leaf type cannot be used here: '_global.search:Response'" - ] - }, "search_mvt": { "request": [ "Request: missing json spec query parameter 'track_total_hits'" diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 6fd614e502..35a0201080 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -542,10 +542,6 @@ export interface MgetResponse { export type MgetResponseItem = GetGetResult | MgetMultiGetError -export interface MsearchMultiSearchItem extends SearchResponse { - status: integer -} - export interface MsearchMultiSearchResult { took: long responses: MsearchResponseItem[] @@ -593,7 +589,7 @@ export type MsearchRequestItem = MsearchMultisearchHeader | MsearchMultisearchBo export type MsearchResponse = MsearchMultiSearchResult -export type MsearchResponseItem = MsearchMultiSearchItem | ErrorResponseBase +export type MsearchResponseItem = SearchResponse | ErrorResponseBase export interface MsearchTemplateRequest extends RequestBase { index?: Indices @@ -1897,7 +1893,7 @@ export type ErrorCause = ErrorCauseKeys export interface ErrorResponseBase { error: ErrorCause - status: integer + status?: integer } export type ExpandWildcard = 'all' | 'open' | 'closed' | 'hidden' | 'none' diff --git a/specification/_global/msearch/types.ts b/specification/_global/msearch/types.ts index 2286e41bf8..61d15e4255 100644 --- a/specification/_global/msearch/types.ts +++ b/specification/_global/msearch/types.ts @@ -65,9 +65,5 @@ export class MultiSearchResult { /** @codegen_names result, failure */ export type ResponseItem = - | MultiSearchItem + | SearchResponse | ErrorResponseBase - -export class MultiSearchItem extends SearchResponse { - status: integer -} diff --git a/specification/_types/Base.ts b/specification/_types/Base.ts index e95d6017d3..6209be1f66 100644 --- a/specification/_types/Base.ts +++ b/specification/_types/Base.ts @@ -73,7 +73,7 @@ export class ErrorResponseBase { // If the error is a string, it means that it was not caused by an exception on ES side, but on the HTTP routing layer. // This should never happen in clients, because we assume we will never send malformed request. error: ErrorCause - status: integer + status?: integer } export class IndicesResponseBase extends AcknowledgedResponseBase {