single-entry-parameter-content-map
Overview
This rule belongs to the openapi-v3-standards-validation
ruleset and states that:
The content
property of the Parameter Object is a map that contains representations of the parameter such that the key represents the media type while the value describes the parameter schema. This content map must contain only one entry.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Error |
Message | Parameter content map contains more than one entries. |
Code | OPENAPI3STANDARDS_V102 |
Type | Validation |
Rule System | Semantic |
Broad Category | Parameters |
Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
Tags | openapi3 openapi standards semantic validation map content schema parameter |
Suggested Fixes
- Keep only one entry in the parameter content map and remove all others.
For More Information
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameter-object:~:text=A%20map%20containing%20the%20representations%20for%20the%20parameter.%20The%20key%20is%20the%20media%20type%20and%20the%20value%20describes%20it.%20The%20map%20MUST%20only%20contain%20one%20entry.
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#parameter-object:~:text=A%20map%20containing%20the%20representations%20for%20the%20parameter.%20The%20key%20is%20the%20media%20type%20and%20the%20value%20describes%20it.%20The%20map%20MUST%20only%20contain%20one%20entry.
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#openapi-specification
- https://docs.apimatic.io/rulesets/overview/