required-2XX-response-content-for-get-operation
Overview
This rule belongs to the openapi-v3-apimatic-linting
ruleset and states that:
GET operations are generally expected to return some form of data for a successful call. Therefore, for GET operations, a response definition with a status code belonging to the 2XX range (except 204) should have a non-empty content mapping defined using the content
property.
Property | Value |
---|---|
Enabled | No |
Maximum Severity | Warning |
Message | The 2XX response in the GET operation has a missing or empty content definition. |
Code | OPENAPI3APIMATIC_L464 |
Type | Linting |
Rule System | Semantic |
Broad Category | OpenAPI Responses |
Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
Tags | openapi3 openapi apimatic semantic linting content response get operation |
Suggested Fixes
- If your GET operation is expected to return some data in the response body, ensure that the response definition has a content mapping defined using the
content
property. - If
content
is defined, ensure that the map is not empty and contains at least one entry. - If your GET operation is not expected to have a response body, you should ignore this lint check or disable it.