This rule belongs to the
openapi-v3-apimatic-linting ruleset and states that:
An operation should have at least one 4XX response defined to indicate that an error may be returned by the API. Please check the responses section of the operation and ensure that at least one 4XX response is properly defined. It is recommended to provide a detailed description of the error in the response message to help clients understand the issue.
|Message||Operation does not contain a 4XX response.|
|Broad Category||OpenAPI Responses|
|Products Impacted||API Transformer, Code Generation, Developer Experience Portal|
- Check that the responses section of the operation is properly defined.
- Ensure that at least one 4XX response is defined for the operation.
- Verify that the 4XX response has a properly formatted schema and a detailed description of the error.
- Use HTTP status codes in the 4XX range, such as 400, 401, 404, 409, etc. to indicate the type of error that may be returned.