Skip to content

fix(parser): trigger custom parsers on operation.channel.messages.*.payload#1177

Open
q404365631 wants to merge 1 commit into
asyncapi:masterfrom
q404365631:fix/operation-channel-payload-1099
Open

fix(parser): trigger custom parsers on operation.channel.messages.*.payload#1177
q404365631 wants to merge 1 commit into
asyncapi:masterfrom
q404365631:fix/operation-channel-payload-1099

Conversation

@q404365631

Copy link
Copy Markdown

What

Adds four new JSONPath entries to customSchemasPathsV3 so custom schema parsers
also fire on payloads/headers reached via operation.channel.messages (when the
channel is $ref'd to an external file).

Why

As reported in #1099, when an AsyncAPI 3.0 document defines an operation like:

operations:
  FooOperation:
    action: send
    channel:
      $ref: otherFile.yaml#/channels/BarChannel

... and the referenced channel defines a messages.AMessage.payload with a custom
schemaFormat, the custom parser is never invoked because
customSchemasPathsV3 did not include $.operations.*.channel.messages.*.payload
(it covered $.operations.*.messages.*.payload but not the channel. intermediate
level). The user-reported workaround (re-declaring the channel under root
channels:) confirmed the path mismatch.

Changes

packages/parser/src/custom-operations/parse-schema.ts: Added 4 paths to
customSchemasPathsV3:

  • $.operations.*.channel.messages.*.payload
  • $.operations.*.channel.messages.*.headers
  • $.components.operations.*.channel.messages.*.payload
  • $.components.operations.*.channel.messages.*.headers

Plus a changeset for @asyncapi/parser (patch).

2 files changed, 17 insertions(+).

Fixes #1099

@changeset-bot

changeset-bot Bot commented Jun 4, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a7d6da9

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

@sonarqubecloud

sonarqubecloud Bot commented Jun 4, 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.

[BUG] Custom Parsers aren't triggered on payloads that are defined though Operations.Channel

1 participant