The Responses Object is a map of Response Objects or References to Response Objects that define the possible responses that can be returned from executing the operation.
The keys in the map represent any known HTTP status codes that the API may return. The HTTP status codes can be defined like below:
Numeric Status Code - for example, 200, 404, or 500. HTTP status codes are defined in RFC 9110 .
Status Code Wildcards - for example, 1XX, 2XX, 3XX, 4XX, or 5XX. A wildcard that matches any status code in the range of its significant digit, for example, 2XX represents status codes 200 to 299 inclusive.
default - A catch-all identifier for any other status codes not defined in the map.
The map must contain at least one successful response code.
All values must be defined as explicit strings (for example,"200") to allow for compatibility between JSON and YAML.
For example:
Any number of extension fields can be added to the responses object that can be used by tooling and vendors.
Response Object in OpenAPI
The Response Object describes a single response that can be returned from executing an operation.
Response Object Fields
Field
Type
String
Required
✅
Description
A description of the response. This may contain CommonMark syntax to provide a rich description.