oas3-server-not-example.com
Server URL must not point at example.com.
- Applies to
url- Selects
$.servers[*].url- Function
pattern- Specs
- OpenAPI 3.0OpenAPI 3.1OpenAPI 3.2
Use it
This rule ships with OpenLint in spectral:oas. It's off by default, so turn it on by name:
extends: spectral:oas
rules:
oas3-server-not-example.com: true
Definition
As defined in @openlint/openlint-rulesets. Functions show by name.
oas3-server-not-example.com:
description: Server URL must not point at example.com.
recommended: false
formats:
- OpenAPI 3.x
given: '$.servers[*].url'
then:
function: pattern
functionOptions:
notMatch: example\.com
About this rule
Server URL should not point to example.com.
Bad Example
servers:
- url: https://example.com/api
description: Production server
- url: https://staging.example.com/api
description: Staging server
- url: http://localhost:3001
description: Development server
We have example.com for documentation purposes here, but you should put in actual domains.