oas2-api-host
In OpenAPI 2 host
needs to be present and not empty.
Tools use this value when generating code, mocks, tests or documentation. It’s important that it’s not left out.
Why did this violation appear?
The host
value is missing, or it’s been left empty.
Bad example
swagger: 2.0
host: ""
paths:
/vacuum:
...
Good example
swagger: 2.0
host: "quobix.com"
schemes:
- "https"
paths:
/vacuum:
...
How do I fix this violation?
Add a host
value. Make sure it’s a real working host and not example.com or similar.
Spectral Equivalent
The rule is equivalent to oas2-api-host