parameter-schema-and-content-are-mutually-exclusive
Overview
This rule belongs to the openapi-v3-standards-validation
ruleset and states that:
The properties schema
and content
in Parameter Object are mutually exclusive. This means that in a Parameter Object instance, only one of these properties must be present at a time but not both.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Error |
Message | Parameter Object contains both schema and content properties. |
Code | OPENAPI3STANDARDS_V078 |
Type | Validation |
Rule System | Semantic |
Broad Category | Parameters |
Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
Tags | openapi3 openapi standards semantic validation schema content type parameter |
Suggested Fixes
- Remove either the
schema
orcontent
property from the Parameter Object. - The
schema
property is used more commonly while propertycontent
is recommended for more complex scenarios involving media types.
For More Information
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#fixed-fields-10
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameter-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#fixed-fields-10
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#parameter-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#openapi-specification
- https://docs.apimatic.io/rulesets/overview/