asyncapi / asyncapi/parser-js

[FEATURE] Support literal curly braces in channel addresses

Open
#1,241 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
144
Forks
144
Avg merge
6m
Merged PRs (30d)
11

Description

## Description

The parser currently treats every non-empty pair of curly braces in a channel address as a parameter expression:
https://github.com/asyncapi/parser-js/blob/228787692e4d7b19526708236b9dc7af8c3507d9/packages/parser/src/ruleset/utils/parseUrlVariables.ts#L1-L6

There is no supported way to mark curly braces as literal characters. However, MQTT, AMQP, and other protocols may use curly braces as ordinary characters in topic names, routing keys, queue names, and other channel addresses. As a result, literal addresses cannot be distinguished from AsyncAPI parameter expressions when channel parameter validation runs.

Please add and document an unambiguous way to represent literal curly braces and exclude them from parameter extraction in both AsyncAPI v2 and v3.

The AsyncAPI specification defines channel address expressions but does not define escaping, so the solution may require coordination with asyncapi/spec:
https://github.com/asyncapi/spec/blob/master/spec/asyncapi.md#channel-address-expressions

Contributor guide

Open the contributing guide

Research direction

Start with packages/parser/src/ruleset/utils/parseUrlVariables.ts and compare how channel parameter validation handles addresses in AsyncAPI v2 and v3. Review the linked AsyncAPI channel address expression specification and coordinate any required change with asyncapi/spec. Done means literal curly braces have an unambiguous representation, are excluded from parameter extraction, and the behavior is documented for both versions.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.