diff --git a/.changeset/fix-operation-channel-payload-1099.md b/.changeset/fix-operation-channel-payload-1099.md new file mode 100644 index 000000000..c755caa6c --- /dev/null +++ b/.changeset/fix-operation-channel-payload-1099.md @@ -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. diff --git a/packages/parser/src/custom-operations/parse-schema.ts b/packages/parser/src/custom-operations/parse-schema.ts index d33c017b4..13020647a 100644 --- a/packages/parser/src/custom-operations/parse-schema.ts +++ b/packages/parser/src/custom-operations/parse-schema.ts @@ -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.*',