asyncapi-servers
AsyncAPI object must have non-empty "servers" object.
- Applies to
servers- Selects
$- Function
schema- Specs
- AsyncAPI 2.xAsyncAPI 3.x
Use it
This rule ships with OpenLint in spectral:asyncapi. Extending the ruleset turns it on:
extends: spectral:asyncapi
rules:
asyncapi-servers: warn # or off, or another severity
Definition
As defined in @openlint/openlint-rulesets. Functions show by name.
asyncapi-servers:
description: AsyncAPI object must have non-empty "servers" object.
recommended: true
formats:
- AsyncAPI 2.x
- AsyncAPI 3.x
given: $
then:
field: servers
function: schema
functionOptions:
schema:
type: object
minProperties: 1
allErrors: true
About this rule
A non-empty servers object is expected to be located at the root of the document.