Skip to content

fix(parser): correct jsonpath for components.messages.*.headers in v3 schema parsing - #1240

Open
RohithPariki wants to merge 1 commit into
asyncapi:masterfrom
RohithPariki:fix/correct-v3-components-messages-headers-path
Open

fix(parser): correct jsonpath for components.messages.*.headers in v3 schema parsing#1240
RohithPariki wants to merge 1 commit into
asyncapi:masterfrom
RohithPariki:fix/correct-v3-components-messages-headers-path

Conversation

@RohithPariki

Copy link
Copy Markdown

Problem

In AsyncAPI v3, customSchemasPathsV3 in packages/parser/src/custom-operations/parse-schema.ts lists paths where custom schemas are parsed.
While channel messages, operation messages, and root message payloads were matched properly, components.messages.*.headers had a trailing .* ('$.components.messages.*.headers.*'), which caused JSONPath to iterate the schema's inner properties instead of targeting the header Schema object itself.
As a result, custom schema formats defined directly on components.messages.<name>.headers were not parsed by registered custom schema parsers.

Additionally, packages/multi-parser/package.json had a typo in the lint:fix npm script (.../../eslintrc).

Solution

  1. Changed '$.components.messages.*.headers.*' to '$.components.messages.*.headers' in customSchemasPathsV3 so that headers Schema objects in components.messages are parsed consistently with all other message header locations.
  2. Added unit test in packages/parser/test/custom-operations/parse-schema-v3.spec.ts verifying custom schemaFormat resolution on components.messages.*.headers.
  3. Fixed typo in packages/multi-parser/package.json lint scripts.

Testing

  • Ran all unit tests in @asyncapi/parser (150 test suites, 2528 passed).
  • Added and verified new test case in packages/parser/test/custom-operations/parse-schema-v3.spec.ts.
  • Ran npm run lint across all workspaces (all passed cleanly).
  • Ran npm run build across all workspaces.

Checklist

  • Unit tests added & pass
  • Lint passes across all packages
  • Build passes across all packages

@changeset-bot

changeset-bot Bot commented Aug 29, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 3f595cd

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our contributors guide useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

@sonarqubecloud

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.

1 participant