From 8c200cfb9c7be4db4c8c98fcc44d9a3bf3419542 Mon Sep 17 00:00:00 2001 From: Steve Gordon Date: Tue, 26 Jan 2021 16:20:07 +0000 Subject: [PATCH] Fix request and response for GET endpoint (#88) --- output/schema/schema.json | 43 ++++++++----------- output/typescript/types.ts | 16 +++---- .../specs/document/single/get/GetRequest.ts | 6 +-- .../specs/document/single/get/GetResponse.ts | 10 ++--- 4 files changed, 33 insertions(+), 42 deletions(-) diff --git a/output/schema/schema.json b/output/schema/schema.json index 781ceae133..1b478a8445 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -30022,13 +30022,10 @@ { "name": "_source_excludes", "type": { - "kind": "array_of", - "value": { - "kind": "instance_of", - "type": { - "namespace": "internal", - "name": "Field" - } + "kind": "instance_of", + "type": { + "namespace": "internal", + "name": "Fields" } }, "required": false, @@ -30037,13 +30034,10 @@ { "name": "_source_includes", "type": { - "kind": "array_of", - "value": { - "kind": "instance_of", - "type": { - "namespace": "internal", - "name": "Field" - } + "kind": "instance_of", + "type": { + "namespace": "internal", + "name": "Fields" } }, "required": false, @@ -30052,13 +30046,10 @@ { "name": "stored_fields", "type": { - "kind": "array_of", - "value": { - "kind": "instance_of", - "type": { - "namespace": "internal", - "name": "Field" - } + "kind": "instance_of", + "type": { + "namespace": "internal", + "name": "Fields" } }, "required": false, @@ -30210,7 +30201,7 @@ "name": "long" } }, - "required": true + "required": false }, { "name": "_routing", @@ -30221,7 +30212,7 @@ "name": "string" } }, - "required": true + "required": false }, { "name": "_seq_no", @@ -30232,7 +30223,7 @@ "name": "long" } }, - "required": true + "required": false }, { "name": "_source", @@ -30243,7 +30234,7 @@ "name": "TDocument" } }, - "required": true, + "required": false, "annotations": { "prop_serializer": "SourceFormatter`1" } @@ -30268,7 +30259,7 @@ "name": "long" } }, - "required": true + "required": false } ] }, diff --git a/output/typescript/types.ts b/output/typescript/types.ts index cd698f57f7..de459e347f 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -3241,9 +3241,9 @@ export interface GetRequest extends RequestBase { refresh?: boolean routing?: Routing source_enabled?: boolean - _source_excludes?: Array - _source_includes?: Array - stored_fields?: Array + _source_excludes?: Fields + _source_includes?: Fields + stored_fields?: Fields version?: long version_type?: VersionType _source?: boolean | string | Array @@ -3254,12 +3254,12 @@ export interface GetResponse extends ResponseBase { fields?: Record found: boolean _id: string - _primary_term: long - _routing: string - _seq_no: long - _source: TDocument + _primary_term?: long + _routing?: string + _seq_no?: long + _source?: TDocument _type: string - _version: long + _version?: long } export interface IndexRequest extends RequestBase { diff --git a/specification/specs/document/single/get/GetRequest.ts b/specification/specs/document/single/get/GetRequest.ts index d3fe8ebf77..f5dedbc779 100644 --- a/specification/specs/document/single/get/GetRequest.ts +++ b/specification/specs/document/single/get/GetRequest.ts @@ -14,9 +14,9 @@ class GetRequest extends RequestBase { refresh?: boolean; routing?: Routing; source_enabled?: boolean; - _source_excludes?: Field[]; - _source_includes?: Field[]; - stored_fields?: Field[]; + _source_excludes?: Fields; + _source_includes?: Fields; + stored_fields?: Fields; version?: long; version_type?: VersionType; _source?: Union>; diff --git a/specification/specs/document/single/get/GetResponse.ts b/specification/specs/document/single/get/GetResponse.ts index fabda43b15..79fa743716 100644 --- a/specification/specs/document/single/get/GetResponse.ts +++ b/specification/specs/document/single/get/GetResponse.ts @@ -6,11 +6,11 @@ class GetResponse extends ResponseBase { fields?: Dictionary; found: boolean; _id: string; - _primary_term: long; - _routing: string; - _seq_no: long; + _primary_term?: long; + _routing?: string; + _seq_no?: long; /** @prop_serializer SourceFormatter`1 */ - _source: TDocument; + _source?: TDocument; _type: string; - _version: long; + _version?: long; }