required-operation-responses
Overview
This rule belongs to the openapi-v3-standards-validation ruleset and states that:
The Operation Object in an OpenAPI v3.0.x document must specify list of possible responses that can be returned from executing this operation, using the responses property.
| Property | Value |
|---|---|
| Enabled | Yes |
| Maximum Severity | Error |
| Message | Required property responses in Operation Object is missing. |
| Code | OPENAPI3STANDARDS_V050 |
| Type | Validation |
| Rule System | Semantic |
| Broad Category | Operations |
| Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
| Tags | openapi3 openapi standards semantic validation responses operation |
Suggested Fixes
- Add missing
responsesproperty in the Operation object. - Make sure that the
responsesproperty is a valid object and not set as null.
For More Information
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#operation-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#responses-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#openapi-specification
- https://docs.apimatic.io/rulesets/overview/