spectral:oas warn off by default

oas2-host-not-example

Host URL must not point at example.com.

Applies to
host
Selects
$
Function
pattern
Specs
OpenAPI 2.0

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:
  oas2-host-not-example: true

Definition

As defined in @openlint/openlint-rulesets. Functions show by name.

oas2-host-not-example:
  description: Host URL must not point at example.com.
  recommended: false
  formats:
    - OpenAPI 2.0 (Swagger)
  given: $
  then:
    field: host
    function: pattern
    functionOptions:
      notMatch: example\.com

About this rule

Server URL should not point to example.com.

Sources