api-morph / ResponsesObject
Interface: ResponsesObject
Defined in: src/types/openapi.ts:751
A container for the expected responses of an operation. The container maps a HTTP response code to the expected response.
See
https://spec.openapis.org/oas/v3.1.1#responses-object
Indexable
[statusCode
: string
]: undefined
| ResponseObject
| ReferenceObject
Any HTTP status code can be used as the property name, but only one property per code, to describe the expected response for that HTTP status code. This field MUST be enclosed in quotation marks (for example, "200") for compatibility between JSON and YAML. To define a range of response codes, this field MAY contain the uppercase wildcard character X
. For example, 2XX
represents all response codes between 200
and 299
. Only the following range definitions are allowed: 1XX
, 2XX
, 3XX
, 4XX
, and 5XX
. If a response is defined using an explicit code, the explicit code definition takes precedence over the range definition for that code.
[key
: `x-${string}`
]: any
This object MAY be extended with Specification Extensions.
Properties
default?
optional
default:ResponseObject
|ReferenceObject
Defined in: src/types/openapi.ts:756
The documentation of responses other than the ones declared for specific HTTP response codes. Use this field to cover undeclared responses.