Skip to content

fix: guard nullable 'message' fields in v2 ruleset (issue #863) - #1229

Open
tzh476 wants to merge 2 commits into
asyncapi:masterfrom
tzh476:fix/863-nullable-message-payload
Open

fix: guard nullable 'message' fields in v2 ruleset (issue #863)#1229
tzh476 wants to merge 2 commits into
asyncapi:masterfrom
tzh476:fix/863-nullable-message-payload

Conversation

@tzh476

@tzh476 tzh476 commented Aug 23, 2026

Copy link
Copy Markdown

Fixes #863.

When a payload object has a nullable property literally named message, v2-ruleset selectors navigating @property === "message" read .schemaFormat/.oneOf on null and crash validation.

Guard added: !@null && before those reads in ruleset/v2/ruleset.ts (message-examples, payload default/examples, operation-message) and ruleset/v2/functions/messageExamples-spectral-rule-v2.ts.

Verified: the issue example now validates with no error diagnostic; ruleset/validate suite passes (43 suites / 244 tests).

…syncapi#863)

Change-Id: Ia9549f33f1c06d3a56c4af9f6d01c6596e645a98
@changeset-bot

changeset-bot Bot commented Aug 23, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2c41141

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

Change-Id: I9fa2cccd89ac357e05c1be34432b042d55edb15c
@sonarqubecloud

Copy link
Copy Markdown

@tzh476

tzh476 commented Aug 24, 2026

Copy link
Copy Markdown
Author

Hi maintainers - friendly ping: this PR (fixes #863, guard nullable message fields) is ready and MERGEABLE, changeset added, CI/SonarCloud passing; happy to adjust on review. Thank you.

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.

Payload property named message breaks with null value

1 participant