required-server-variable-default-value
Overview
This rule belongs to the openapi-v3-standards-validation
ruleset and states that:
The Server Variable Object must specify a default value for the variable using the 'default' property that can be substituted in the server URL in case no other value is supplied at the time of making the request. If the default value is not provided, a dummy value will be assigned automatically during import/transformations in APIMatic.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Error |
Message | Required property default in Server Variable Object is missing. |
Code | OPENAPI3STANDARDS_V030 |
Type | Validation |
Rule System | Semantic |
Broad Category | Server Variables |
Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
Tags | openapi3 openapi standards semantic validation default variable server |
Suggested Fixes
- Add missing
default
property in the Server Variable Object. - Make sure that the
default
property value is not null or empty.
For More Information
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#server-variable-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#server-variable-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#openapi-specification
- https://docs.apimatic.io/rulesets/overview/