at-least-one-server-in-servers-list
Overview
This rule belongs to the openapi-v3-codegen-linting
ruleset and states that:
The OpenAPI specification requires that an API definition must include a list of servers that are used to access the API. This rule enforces the requirement that the servers array must contain at least one server definition.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Error |
Message | At least one server definition must be specified in the servers array. |
Code | OPENAPI3CODEGEN_L093 |
Type | Linting |
Rule System | Semantic |
Broad Category | OpenAPI Servers |
Products Impacted | Code Generation, Developer Experience Portal |
Tags | code generation sdks openapi3 openapi semantic linting apimatic servers server api |
Suggested Fixes
- Ensure that the servers property is present in the specification.
- If the servers property is present, check that it contains at least one server definition.
- If there are no servers defined, add a new server definition to the servers array to access the API.