# servers-defined

Source: https://apigenie.pl/docs/linter/openapi/rules/servers-defined

A rule of the OpenAPI linter, which reads OpenAPI 3.0, 3.1 and 3.2 documents. Since 0.0.1. In the rulesets: Recommended at warning, Strict at error, All at error.

This rule checks that the document has at least one server.

## Rule details

The servers are where the API is: without them, documentation cannot offer a "try it" call,
a generated client has no default base URL, and `apigenie-server` cannot take the base path from
the document.

The rule reports `No servers defined` on the document.

## Examples

**Good**.

```yaml
servers:
  - url: https://api.dev.example.com/v1
    description: Development server
```

**Bad**. A document without `servers`.

```yaml
openapi: 3.1.0
info:
  title: Example API
  version: 1.0.0
paths: {}
```
