operation-servers-redefine-root-and-path-servers
Overview
This rule belongs to the openapi-v3-standards-linting
ruleset and states that:
If servers are defined at Operation Object level as well as at either Path Item Object level or root OpenAPI Object level, the Operation Object level servers will override the servers defined elsewhere (Path Item Object or at root level).
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Information |
Message | Operation Object level servers override the Path Item Object level/root OpenAPI Object level servers. |
Code | OPENAPI3STANDARDS_L042 |
Type | Linting |
Rule System | Semantic |
Broad Category | Operations |
Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
Tags | openapi3 openapi standards semantic linting servers operation global path |
Suggested Fixes
- If you do not intend to override any Path Item Object level or root level servers or the Operation level servers do not add any new information as compared to the servers defined elsewhere, consider removing the Operation Object level server entries.
For More Information
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#server-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#operation-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#openapi-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#path-item-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#server-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#operation-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#openapi-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#path-item-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md
- https://docs.apimatic.io/rulesets/overview/