header-examples-override-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 examples will override the Schema Object level example.
| Property | Value |
|---|---|
| Enabled | Yes |
| Maximum Severity | Information |
| Message | Header Object level examples found that overrides the example present in the header's schema definition. |
| Code | OPENAPI3STANDARDS_V253 |
| Type | Validation |
| Rule System | Semantic |
| Broad Category | Headers |
| Products Impacted | API Transformer, Developer Experience Portal |
| Tags | openapi3 openapi standards semantic validation examples header schema |
Suggested Fixes
- If the header schema level examples adds no new example value as compared to the one at Header Object level, remove the schema level
exampleproperty.
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/