Skip to content

Commit

Permalink
Fix request and response for GET endpoint (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevejgordon authored Jan 26, 2021
1 parent f2e8f74 commit 8c200cf
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 42 deletions.
43 changes: 17 additions & 26 deletions output/schema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -30210,7 +30201,7 @@
"name": "long"
}
},
"required": true
"required": false
},
{
"name": "_routing",
Expand All @@ -30221,7 +30212,7 @@
"name": "string"
}
},
"required": true
"required": false
},
{
"name": "_seq_no",
Expand All @@ -30232,7 +30223,7 @@
"name": "long"
}
},
"required": true
"required": false
},
{
"name": "_source",
Expand All @@ -30243,7 +30234,7 @@
"name": "TDocument"
}
},
"required": true,
"required": false,
"annotations": {
"prop_serializer": "SourceFormatter`1"
}
Expand All @@ -30268,7 +30259,7 @@
"name": "long"
}
},
"required": true
"required": false
}
]
},
Expand Down
16 changes: 8 additions & 8 deletions output/typescript/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3241,9 +3241,9 @@ export interface GetRequest extends RequestBase {
refresh?: boolean
routing?: Routing
source_enabled?: boolean
_source_excludes?: Array<Field>
_source_includes?: Array<Field>
stored_fields?: Array<Field>
_source_excludes?: Fields
_source_includes?: Fields
stored_fields?: Fields
version?: long
version_type?: VersionType
_source?: boolean | string | Array<string>
Expand All @@ -3254,12 +3254,12 @@ export interface GetResponse<TDocument = unknown> extends ResponseBase {
fields?: Record<string, LazyDocument>
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<TDocument = unknown> extends RequestBase {
Expand Down
6 changes: 3 additions & 3 deletions specification/specs/document/single/get/GetRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<boolean, Union<string, string[]>>;
Expand Down
10 changes: 5 additions & 5 deletions specification/specs/document/single/get/GetResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ class GetResponse<TDocument> extends ResponseBase {
fields?: Dictionary<string, LazyDocument>;
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;
}

0 comments on commit 8c200cf

Please sign in to comment.