required-servers
Overview
This rule belongs to the openapi-v3-codegen-linting ruleset and states that:
OpenAPI root object must specify at least one server using the servers property. Information about the servers provide connectivity information related to a target server of the API. Empty servers defaults to localhost which can prevent your end-users from consuming your API.
| Property | Value |
|---|---|
| Enabled | Yes |
| Maximum Severity | Error |
| Message | No API server found. |
| Code | OPENAPI3CODEGEN_L092 |
| 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 list has been defined in the root OpenAPI object.
- Ensure that the servers list contains at least one Server Object definition.
- Ensure that the Server Object contains all required properties.