diff --git a/output/schema/schema.json b/output/schema/schema.json index 3c3860ff0e..fa5d81a480 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -17342,6 +17342,44 @@ } } }, + "exceptions": [ + { + "body": { + "kind": "value", + "value": { + "items": [ + { + "generics": [ + { + "kind": "instance_of", + "type": { + "name": "TDocument", + "namespace": "_global.get" + } + } + ], + "kind": "instance_of", + "type": { + "name": "GetResult", + "namespace": "_global.get" + } + }, + { + "kind": "instance_of", + "type": { + "name": "ErrorResponseBase", + "namespace": "_types" + } + } + ], + "kind": "union_of" + } + }, + "statusCodes": [ + 404 + ] + } + ], "generics": [ { "name": "TDocument", @@ -17353,7 +17391,7 @@ "name": "Response", "namespace": "_global.get" }, - "specLocation": "_global/get/GetResponse.ts#L22-L24" + "specLocation": "_global/get/GetResponse.ts#L23-L34" }, { "attachedBehaviors": [ diff --git a/specification/_global/get/GetResponse.ts b/specification/_global/get/GetResponse.ts index fd20053d18..7a0fd0c4c8 100644 --- a/specification/_global/get/GetResponse.ts +++ b/specification/_global/get/GetResponse.ts @@ -18,7 +18,17 @@ */ import { GetResult } from '@global/get/types' +import { ErrorResponseBase } from '@_types/Base' export class Response { body: GetResult + exceptions: [ + { + // Special case exception for 404 status code, Elasticsearch will return either: + // * index_not_found_exception as an error if the index doesn't exist + // * GetResult with only the requested _id, _index properties and found as a false boolean + statusCodes: [404] + body: GetResult | ErrorResponseBase + } + ] }