Repository navigation
[BUG] bundle creates invalid document (refs) #1989
Description
Activity
When I move
channelsandoperationsto root the produced doc is fine.Hey @Shurtu-gal @Souvikns @AayushSaini101 ,
Edit: My earlier comment was about asyncapi optimize, which is not relevant to this issue — thanks for flagging that.
For asyncapi bundle, the problem is that the bundled output keeps $refs pointing to #/components/... while the actual channels, operations, and messages are moved to the root, resulting in an invalid document.
The bundler should either rewrite $refs to the new root paths or keep the referenced definitions under components consistently.
@Varadraj75 did you mean to post this here (vs. in my optimize bug ticket)? This issue is about bundling.
@black-snow
Thanks for the clarification — you’re right, my earlier comment was about optimize, not bundle.For bundling, the issue seems to be that $refs still point to #/components/... even though the bundled output moves channels/operations/messages to the root, making the document invalid.
The bundler should either rewrite those $refs to the new root paths or keep the definitions under components consistently.
Reacted by RonaldShould i work on it?
Reacted by Ronaldgithub-actions commented
on Jun 18, 2026 on Jun 18, 2026 – with GitHub ActionsContributorMore actionsThis issue has been automatically marked as stale because it has not had recent activity 😴
It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.
There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.
Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.
Thank you for your patience ❤️
Should I try this issue?
I'd like to work on this. I can still reproduce it on CLI 6.2.0, and also with the latest @asyncapi/bundler (1.0.2), so it isn't fixed yet.
I looked into it and the issue is in the bundler, not the CLI itself. For v3 documents the bundler intentionally keeps refs like
operations.*.channelandoperations.*.messagesas refs. But when the operation is pulled in from another file, those refs still point to that file's own#/components/..., and after bundling they point to paths that don't exist in the output. I think asyncapi/bundler#237 has the same root cause, just withchannels.*.servers.Since the bundler is planned to move into the CLI (asyncapi/bundler#235), where would you prefer the fix: in asyncapi/bundler now, or after the migration in this repo? Happy to go either way.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsTo Triage
Describe the bug.
asyncapi bundlecreates invalid documents.main.yaml_sub.yamlproduced invalid output:
Expected behavior
It should've either updated the refs to root or moved the channels/ops/messages to
components(if allowed).Screenshots
How to Reproduce
see above
🖥️ Device Information [optional]
👀 Have you checked for similar open issues?
🏢 Have you read the Contributing Guidelines?
Are you willing to work on this issue ?
No, someone else can work on it