asyncapi-operation-channel
asyncapi-operation-channel checks that each operation has a valid channel reference.
Why did this violation appear?
An operation is missing channel, or the channel reference does not point to an existing root or component channel.
Bad example
asyncapi: 3.1.0
channels: {}
operations:
receiveUserCreated:
action: receive
messages:
- $ref: '#/components/messages/MissingMessage'
components:
messages: {}
Good example
asyncapi: 3.1.0
channels:
userCreated:
address: users/created
operations:
receiveUserCreated:
action: receive
description: Receive user creation events.
channel:
$ref: '#/channels/userCreated'
messages:
- $ref: '#/components/messages/UserCreated'
components:
messages:
UserCreated:
payload:
type: object
How do I fix this violation?
Add the missing channel or update the operation to reference the channel that really carries the messages.
