only-one-body-parameter-in-operation-parameters
Overview
This rule belongs to the swagger-v2-standards-validation
ruleset and states that:
The parameters list provided using the 'parameters' property in the Operation Object must not include more than one 'body' parameter definitions. Body parameters with different names should also not be defined simultaneously in the Operation Object and Path Item Object. If multiple body parameters are found, their location will be automatically updated to formData
during import/transformations in APIMatic.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Error |
Message | More than one 'body' parameter found in operation parameters list. |
Code | SWAGGER20STANDARDS_V068 |
Type | Validation |
Rule System | Semantic |
Broad Category | Operations |
Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
Tags | swagger2 swagger standards semantic validation parameters parameter body operation type |
Suggested Fixes
- Remove additional 'body' parameters from the parameters list.
- Ensure that an entry for a body parameter does not exist both in the Path Item Object and Operation Object
parameters
list with different names. - Parameter types are compared in a case-sensitive manner.
For More Information
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#parameter-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#path-item-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#operation-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md
- https://docs.apimatic.io/rulesets/overview/