fix: handle null message objects in spectral JSONPath filters - #1232
fix: handle null message objects in spectral JSONPath filters#1232Luvi-1 wants to merge 1 commit into
Conversation
When a payload property is named message and has a null value in an example, JSONPath filter expressions that check @.schemaFormat crash with a TypeError. Added !@null guards matching the pattern already used by other paths in the same ruleset. Fixes asyncapi#863
|
There was a problem hiding this comment.
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.
|



Description
When a payload property is literally named and has a value (e.g. in a message example), the spectral JSONPath filter expressions that check crash with:
This happens because the filter expression walks into the payload's properties and encounters the property named with value , then tries to read on it.
Several paths already had guards; this PR adds them to all expressions that were missing them.
Before / after
Before:
After:
Fixes #863