fix(bundle): don't look for a $ref
pointer on a null value
#393
+54
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We had some customers of our CLI tool report issues1 this morning of sudden crashes when attempting to validate an OpenAPI definition after we published a new release of our OpenAPI parser1 that included an upgrade from v13.0.5 to v14.1.0 with the following error:
We were able to narrow it down to a regression introduced in #391 where it looks for a
$ref
pointer to supply to theonBundle
callback. The problem our customers had, and we were able to reproduce, encountered with this was on nullish schema examples and this work attempting to look for a$ref
pointer in it:The fix I've submitted here is to just wrap this check in a type assertion to ensure that we're only looking for a
$ref
pointer in an object.Footnotes
https://github.com/readmeio/rdme/issues/1306 ↩ ↩2