-
Notifications
You must be signed in to change notification settings - Fork 87
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
fix: handle multi-file spec circular reference edge case #333
Conversation
Codecov Report
@@ Coverage Diff @@
## main #333 +/- ##
==========================================
+ Coverage 91.90% 91.92% +0.01%
==========================================
Files 73 73
Lines 2348 2353 +5
Branches 598 600 +2
==========================================
+ Hits 2158 2163 +5
Misses 157 157
Partials 33 33
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I see that you plan to add a test, but approving so you can merge once you add the test.
The validator chokes on a specific scenario - when a multi-file spec has schemas that reference each other in a ciruclar manner across files. The bundler we use to put together mutli-file specs doesn't store the reference in a helpful way, so there's not really a way to report the location of the circular reference the way we do for other scenarios. All we can really do is avoid crashing completely and send the user the fully resolved path to the problematic schema that they will need to trace manually. A test is added to capture the behavior. This test case would exhibit the crash without the fix.
1ee7897
to
681ae05
Compare
## [0.50.1](v0.50.0...v0.50.1) (2021-09-29) ### Bug Fixes * handle multi-file spec circular reference edge case ([#333](#333)) ([172c027](172c027))
🎉 This PR is included in version 0.50.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
The validator chokes on a specific scenario - when a multi-file spec
has schemas that reference each other in a ciruclar manner across files.
The bundler we use to put together mutli-file specs doesn't store the
reference in a helpful way, so there's not really a way to report the
location of the circular reference the way we do for other scenarios.
All we can really do is avoid crashing completely and send the user the
fully resolved path to the problematic schema that they will need to
trace manually.
A test is added to capture the behavior. This test case would exhibit the
crash without the fix.
Resolves #326