Skip to content

[BUG] Parser incorrectly rejects valid $refs to component messages with square brackets in names within channels.messages #1132

@vvlrff

Description

@vvlrff

Describe the bug.

asyncapi/asyncapi-react#1240 (comment)

Expected behavior

The document should validate successfully. The $ref in channels.test:[HandleFirst,HandleSecond].messages.SubscribeMessage should be accepted.

Screenshots

Image

How to Reproduce

Create an AsyncAPI 3.0.0 document where channel/operation/message keys contain special characters such as [, ], , (e.g., test-queue::[Handle,DefaultHandler]:SubscribeMessage)
Use $ref pointing to such a key: "$ref": "#/components/messages/test-queue:
:[Handle,DefaultHandler]:SubscribeMessage"
Open the document in AsyncAPI Studio (or run it through the validator)
The document fails to render / $ref is not resolved, even though square brackets and commas are valid characters in JSON Pointer (RFC 6901) and are not required to be escaped

🖥️ Device Information [optional]

No response

👀 Have you checked for similar open issues?

  • I checked and didn't find similar issue

🏢 Have you read the Contributing Guidelines?

Are you willing to work on this issue ?

Yes I am willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions