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