Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .changeset/fix-operation-channel-payload-1099.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
"@asyncapi/parser": patch
---

fix(parser): trigger custom parsers on operation.channel.messages.*.payload and headers

When a v3 AsyncAPI operation references its channel via `$ref` to an external file,
the messages and their payload/headers reach the parser through the path
`$.operations.*.channel.messages.*.payload` (or `headers`). This path was missing
from `customSchemasPathsV3`, so non-default schema parsers were silently skipped for
these schemas, causing downstream tools such as `@asyncapi/react-component` to fail
to render them.
5 changes: 5 additions & 0 deletions packages/parser/src/custom-operations/parse-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ const customSchemasPathsV3 = [
'$.operations.*.messages.*.headers',
'$.components.operations.*.messages.*.payload',
'$.components.operations.*.messages.*.headers',
// operations -> channel (which may $ref an external file) -> messages
'$.operations.*.channel.messages.*.payload',
'$.operations.*.channel.messages.*.headers',
'$.components.operations.*.channel.messages.*.payload',
'$.components.operations.*.channel.messages.*.headers',
// messages
'$.components.messages.*.payload',
'$.components.messages.*.headers.*',
Expand Down
Loading