spectral:asyncapi error on by default

asyncapi-channel-parameters

Channel parameters must be defined and there must be no redundant parameters.

Applies to
channels
Selects
$.channels.*
$.components.channels.*
Function
asyncApiChannelParameters
Specs
AsyncAPI 2.xAsyncAPI 3.x
Message
{{error}}

Use it

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

extends: spectral:asyncapi
rules:
  asyncapi-channel-parameters: error   # or off, or another severity

Definition

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

asyncapi-channel-parameters:
  description: >-
    Channel parameters must be defined and there must be no redundant
    parameters.
  message: '{{error}}'
  severity: error
  recommended: true
  formats:
    - AsyncAPI 2.x
    - AsyncAPI 3.x
  given:
    - $.channels.*
    - $.components.channels.*
  then:
    function: asyncApiChannelParameters

About this rule

All channel parameters should be defined in the parameters object of the channel. They should also not contain redundant parameters that do not exist in the channel address.

Sources