Skip to main content

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.

PropertyValue
EnabledYes
Maximum SeverityError
MessageAt least one server definition must be specified in the servers array.
CodeOPENAPI3CODEGEN_L093
TypeLinting
Rule SystemSemantic
Broad CategoryOpenAPI Servers
Products ImpactedCode Generation, Developer Experience Portal
Tagscode 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.

For More Information