asyncapi-3-server-no-empty-variable
asyncapi-3-server-no-empty-variable checks host and pathname template strings for empty {} placeholders.
Why did this violation appear?
A server host or pathname contains {} instead of a named variable.
Bad example
asyncapi: 3.1.0
servers:
production:
host: '{}.events.example.com/'
pathname: /events/{unused}/
protocol: mqtt
variables:
stale:
default: acme
Good example
asyncapi: 3.1.0
servers:
production:
host: '{tenant}.events.example.com'
pathname: /events/{region}
protocol: mqtt
variables:
tenant:
default: acme
region:
default: us-east
How do I fix this violation?
Name the variable and declare it under the server variables object.
