server-parameter-cannot-be-constant
Overview
This rule belongs to the openapi-v3-apimatic-linting
ruleset and states that:
A server URL template with a parameter allows the user to substitute a value into the URL at runtime, such as for different environments. Declaring a parameter as a constant would make it impossible to substitute different values into the URL. Hence, server URL parameter cannot be declared as constant.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Error |
Message | Server URL parameter declared as constant which is not allowed. |
Code | OPENAPI3APIMATIC_L123 |
Type | Linting |
Rule System | Semantic |
Broad Category | OpenAPI Servers |
Products Impacted | API Transformer, Code Generation |
Tags | openapi3 openapi apimatic semantic linting server parameter type url |
Suggested Fixes
- Remove any attributes of the server URL parameter that makes it constant.
For More Information
- https://docs.apimatic.io/specification-extensions/swagger-server-configuration-extensions/#server-configuration-object
- https://docs.apimatic.io/specification-extensions/swagger-server-configuration-extensions/#parameter-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md
- https://docs.apimatic.io/rulesets/overview/