required-parameter-schema-or-content
Overview
This rule belongs to the openapi-v3-standards-validation
ruleset and states that:
The Parameter Object must define the type schema for the parameter using either the schema
or content
property. The former is used more commonly while the latter is recommended for more complex scenarios involving media types. However, at one time, only one of these properties must be present and not both.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Error |
Message | Parameter Object has neither defined property schema nor content . |
Code | OPENAPI3STANDARDS_V077 |
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
- Add missing
schema
orcontent
property in the Parameter Object. - Make sure that whatever property you specify (
schema
orcontent
) is a valid object and is not set to null.
For More Information
- 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#parameter-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#openapi-specification
- https://docs.apimatic.io/rulesets/overview/