parameter-example-overrides-schema-example
Overview
This rule belongs to the openapi-v3-standards-validation
ruleset and states that:
An example for a parameter can be provided in multiple ways: either directly in the Parameter Object using the examples
/example
property or within the parameter level schema
definition using the example
property. If an example is provided at both levels, the Parameter Object level example
will override the Schema Object level example
.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Information |
Message | Parameter Object level example found that overrides the example present in the parameter's schema definition. |
Code | OPENAPI3STANDARDS_V100 |
Type | Validation |
Rule System | Semantic |
Broad Category | Parameters |
Products Impacted | API Transformer, Developer Experience Portal |
Tags | openapi3 openapi standards semantic validation example parameter schema |
Suggested Fixes
- If the parameter schema level example adds no new example value as compared to the one at Parameter Object level, remove the schema level
example
property.
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.1.0.md#schema-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#schema-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#openapi-specification
- https://docs.apimatic.io/rulesets/overview/