spectral:oas warn on by default

oas2-api-host

OpenAPI "host" must be present and non-empty string.

Applies to
host
Selects
$
Function
truthy
Specs
OpenAPI 2.0

Use it

This rule ships with OpenLint in spectral:oas. Extending the ruleset turns it on:

extends: spectral:oas
rules:
  oas2-api-host: warn   # or off, or another severity

Definition

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

oas2-api-host:
  description: OpenAPI "host" must be present and non-empty string.
  recommended: true
  formats:
    - OpenAPI 2.0 (Swagger)
  given: $
  then:
    field: host
    function: truthy

About this rule

OpenAPI host must be present and non-empty string.

Sources