mma5997
4 years agoOccasional Contributor
How to have a custom status code in response
responses:
'777':
description: My Custom
content:
application/json:
schema:
type: string If I have "777" like fieldName ...
- 4 years ago
OpenAPI only supports the standard HTTP status codes from the 1xx-5xx range. You can provide custom codes and messages in the body of error responses, for example:
responses: '400': description: Bad request content: application/json: schema: type: object properties: code: type: integer example: 777 message: type: string example: Lorem ipsum