required-request-body-for-post-operation
Overview
This rule belongs to the openapi-v3-apimatic-linting ruleset and states that:
A request body is required for HTTP POST method. Please ensure that the operation with the POST method has a properly defined request body. Check the schema and properties of the request body to ensure that they are correctly defined. If the operation does not require a request body, consider using a different HTTP method such as GET, PUT or DELETE instead.
| Property | Value |
|---|---|
| Enabled | No |
| Maximum Severity | Warning |
| Message | Request body is required for POST method. |
| Code | OPENAPI3APIMATIC_L237 |
| Type | Linting |
| Rule System | Semantic |
| Broad Category | OpenAPI Operations |
| Products Impacted | Code Generation, Developer Experience Portal |
| Tags | openapi3 openapi apimatic semantic linting post request body |
Suggested Fixes
- Ensure that request bodies are defined for http method.
- Verify that the request body schema is defined correctly and is valid according to the OpenAPI specification.