Describe the bug.
I have a 3.0.0 schema that looks like this:
asyncapi: 3.0.0
info:
title: My Sample Schema
version: 1.0.0
description: A schema depicting an issue with operation.messages()
servers:
production:
host: myhost.com
protocol: ws
pathname: /ws
description: A Websocket Server
channels:
someChannel:
address: someChannel
description: A Channel
messages:
publish.Message1:
$ref: "#/components/messages/PublishOnlyMessage1"
publish.Message2:
$ref: "#/components/messages/PublishOnlyMessage2"
operations:
someChannel.publish:
action: send
channel:
$ref: "#/channels/someChannel"
messages:
- $ref: "#/channels/someChannel/messages/publish.Message1"
- $ref: "#/channels/someChannel/messages/publish.Message2"
someChannel.subscribe:
action: receive
channel:
$ref: "#/channels/someChannel"
components:
messages:
PublishOnlyMessage1:
name: PublishOnlyMessage1
payload:
type: object
additionalProperties: false
properties:
message1Text:
type: string
PublishOnlyMessage2:
name: PublishOnlyMessage2
payload:
type: object
additionalProperties: false
properties:
message2Text:
type: string
It is my understanding that the someChannel.publish operation should contain two messages: PublishOnlyMessage1 and PublishOnlyMessage2, however the someChannel.subscribe operation should contain NO messages.
In reality however, both operations contain both messages. Here's a screenshot where I placed a breakpoin in Operation.js and each time it was hit, I inspected the values of operation.action() and operation.messages():

You can see that for both operations, the messages() contain both messages. This is also evident from the markdown file that is generated.
Expected behavior
Only the someChannel.publish operation should list out both messages, the someChannel.subscribe operation should not generate any messages.
However, perhaps my misunderstanding about the relationships between operations, channels and messages.
Screenshots

How to Reproduce
- Add the schema file included above
- Run
npm run dev
- Checkout the
test/output/asyncapi/md file
🖥️ Device Information [optional]
- Operating System (OS): Windows 11, WSL2, Ubuntu 24.04.2 LTS
- Browser:
- Browser Version:
👀 Have you checked for similar open issues?
🏢 Have you read the Contributing Guidelines?
Are you willing to work on this issue ?
None
Describe the bug.
I have a 3.0.0 schema that looks like this:
It is my understanding that the
someChannel.publishoperation should contain two messages:PublishOnlyMessage1andPublishOnlyMessage2, however thesomeChannel.subscribeoperation should contain NO messages.In reality however, both operations contain both messages. Here's a screenshot where I placed a breakpoin in
Operation.jsand each time it was hit, I inspected the values ofoperation.action()andoperation.messages():You can see that for both operations, the
messages()contain both messages. This is also evident from the markdown file that is generated.Expected behavior
Only the
someChannel.publishoperation should list out both messages, thesomeChannel.subscribeoperation should not generate any messages.However, perhaps my misunderstanding about the relationships between operations, channels and messages.
Screenshots
How to Reproduce
npm run devtest/output/asyncapi/mdfile🖥️ Device Information [optional]
👀 Have you checked for similar open issues?
🏢 Have you read the Contributing Guidelines?
Are you willing to work on this issue ?
None