Skip to content

fix: validate channel address when parameters are defined#1123

Open
abhi-03-kh wants to merge 3 commits intoasyncapi:masterfrom
abhi-03-kh:fix/channel-parameters-validation
Open

fix: validate channel address when parameters are defined#1123
abhi-03-kh wants to merge 3 commits intoasyncapi:masterfrom
abhi-03-kh:fix/channel-parameters-validation

Conversation

@abhi-03-kh
Copy link

Description

This PR adds a validation rule to ensure that if a Channel Object has parameters defined, the address field must not be null.

Fixes #875

Changes

  • feat: Added channel-parameters-require-address rule to v3/ruleset.ts.
  • test: Added channel-parameters.spec.ts to verify the rule catches invalid documents.

Verification

  1. Run the new test:
    npm test -- test/ruleset/rules/v3/channel-parameters.spec.ts

@changeset-bot
Copy link

changeset-bot bot commented Jan 21, 2026

🦋 Changeset detected

Latest commit: e0fd14a

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

Copy link

@github-actions github-actions bot left a comment

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.

@abhi-03-kh
Copy link
Author

@fmvilas @magicmatatjahu , any feedback on this when you have time?

@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 4, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Parser do not validate and throw error when parameters are provided but address is null

2 participants