Skip to content

fix(bundle): don't look for a $ref pointer on a null value #393

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 15, 2025

Conversation

erunion
Copy link
Contributor

@erunion erunion commented Jul 15, 2025

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:

Cannot read properties of null (reading '$ref')

We were able to narrow it down to a regression introduced in #391 where it looks for a $ref pointer to supply to the onBundle 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:

Screenshot 2025-07-15 at 3 31 35 PM

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

  1. https://github.com/readmeio/rdme/issues/1306 2

@jonluca
Copy link
Collaborator

jonluca commented Jul 15, 2025

LGTM - thanks!

@jonluca jonluca merged commit c1b2916 into APIDevTools:main Jul 15, 2025
13 checks passed
@coveralls
Copy link

Pull Request Test Coverage Report for Build 16305772887

Details

  • 4 of 4 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.4%) to 88.679%

Totals Coverage Status
Change from base Build 16106900928: 0.4%
Covered Lines: 1767
Relevant Lines: 1952

💛 - Coveralls

Copy link

🎉 This PR is included in version 14.1.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants