Skip to content

Latest commit

 

History

History
78 lines (54 loc) · 1.93 KB

no-server-example-com.md

File metadata and controls

78 lines (54 loc) · 1.93 KB
slug
/docs/cli/rules/oas/no-server-example-com

no-server-example.com

Prevents using example.com as the value of the servers.url fields in your API descriptions. The rule checks for all URL schemes (http, https...).

OAS Compatibility
2.0
3.0
3.1
flowchart TD

root ==> ServersList

style ServersList fill:#codaf9,stroke:#0044d4,stroke-width:5px
Loading

API design principles

Although commonly used in different kinds of documentation, example.com is not a real API server. Your consumers cannot use it to test your APIs. Be helpful - give them something they can use.

If you can't reveal a production server, consider a Redocly mock server instead.

Configuration

Option Type Description
severity string Possible values: off, warn, error. Default warn (in recommended configuration).

An example configuration:

rules:
  no-server-example.com: error

Examples

Given this configuration:

rules:
  no-server-example.com: error

Example of incorrect server:

servers:
  - url: https://example.com
    description: Example server

Example of correct server:

servers:
  - url: https://swift-squirrel.remockly.com
    description: Mock server

Related rules

Resources