Skip to content

fix: allow reusing referenced messages and operations with messageId/operationId (#793) - #1271

Open
hoanle0126 wants to merge 1 commit into
asyncapi:masterfrom
hoanle0126:fix/reused-message-operation-id-uniqueness
Open

hoanle0126 wants to merge 1 commit into
asyncapi:masterfrom
hoanle0126:fix/reused-message-operation-id-uniqueness

Conversation

@hoanle0126

Copy link
Copy Markdown

Description

  • Track already-visited MessageObject references in messageIdUniqueness and OperationObject references in operationIdUniqueness so that reusing the same component message or channel/operation via $ref across multiple operations/channels does not trigger a false-positive duplicate ID error.
  • Distinct messages or operations that define the same messageId or operationId (directly or via traits) continue to be flagged as errors.
  • Add unit tests covering reused $ref messages/operations as well as distinct $ref components with duplicate IDs.

Related issue(s)
Resolves #793

@changeset-bot

changeset-bot Bot commented Nov 1, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a744d1a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@asyncapi/parser Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our contributors guide useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

@sonarqubecloud

sonarqubecloud Bot commented Nov 1, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"messageId" must be unique across all the messages.

1 participant