generator-asyncapi: append AsyncAPI specs to service specifications instead of replacing them
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 56/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
Research direction
Start with packages/generator-asyncapi/src/index.ts around mergeAsyncApiIntoSpecifications (referenced at lines 203–209), then review the OpenAPI generator's handling of multiple paths and the specifications utilities. Add or update tests for merging two documents and rerunning the generator; done means both appear in the service spec view without duplicates or dropped entries, while a new service with one document still works. The issue leaves copied-file naming and service markdown behavior as design details to resolve.
Written by the indexing model from the issue text.
Description
Problem
When several AsyncAPI documents are merged into one service (same id and version in the generator config), only the last document processed shows up in the service's spec view.
Both files are copied into the service folder, but mergeAsyncApiIntoSpecifications keeps a single AsyncAPI entry:
- array form: drops all existing
type: asyncapientries and appends one - object form: overwrites
asyncapiPath
A two-entry array added by hand is reduced back to one on the next run.
Ref on main @ d061d78: packages/generator-asyncapi/src/index.ts L203-L209
Core already supports this: specifications can be an array of { type, path, name?, headers? } with several AsyncAPI entries (4.12.x and 5.x), and each gets its own page.
Proposal
- When merging into an existing service of the same version, keep existing AsyncAPI entries with a different
pathand add or replace bypath(normalise the legacy object form to the array form), usinginfo.titleasname. - Optionally accept
path: string[]on a service entry, like the OpenAPI generator already does (generator-openapi/src/index.tsL386-L392 and its specifications utils), so one entry can take several documents. - Spec files need distinct basenames when copied into the service folder, or they overwrite each other. Handle or document that.
Done when
- Two AsyncAPI documents merged into one service both appear in
specificationsand both render in the spec view. - Re-running the generator is idempotent (no duplicates, no dropped entries).
- A new service still works with a single document.
- Tests cover the merge and re-run cases.
Context
Raised by a community user at Taxfix who has one deployable with two AsyncAPI documents (hand-written domain events plus CLI-generated analytics events). They also noted the service page text comes from the first document processed, so they set generateMarkdown on that entry to show the other document's description. Worth keeping in mind when deciding how merged services pick their markdown and name.
Related
- Companion issue: option to default message versions to the document's
info.version. - #431 (closed): multiple OpenAPI files on one service, only one shown
- event-catalog/eventcatalog#1117 (closed): introduced the
specificationsarray - #407: output depends on the order AsyncAPI files are processed
The user has offered to test.
- Dominant language
- TypeScript
- Stars
- 15
- Forks
- 15
- Avg merge
- 3m
- Merged PRs (30d)
- 7
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from event-catalog/generators
-
generator-asyncapi: option to default message (and channel) versions to the document's info.versionOpen
Difficulty 4/5 3-5 days Newbie friendliness 55/100
event-catalog/generators#457 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
event-catalog/generators#451 · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
event-catalog/generators#450 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
event-catalog/generators#449 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
event-catalog/generators#440 ·
All issues in event-catalog/generators
Similar issues
-
Difficulty 1/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
area:plugins area:security area:skills bug has repro
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
anthropics/claude-code#105911 ·
Maintainers usually reply within 1 day
-
documentation good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
dev-five-git/devup-ui#879 ·
Maintainers usually reply within 11 days
-
openspec-apply-change skill: when blocked, may select a ready artifact unrelated to missingArtifactsOpen
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Fission-AI/OpenSpec#2165 ·
Maintainers usually reply within 1 day
-
🐞 bug 🧐 unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Tencent/tdesign-vue-next#7032 · 1 comment ·
Maintainers usually reply within 1 day