-
-
Notifications
You must be signed in to change notification settings - Fork 96
Fix Regression In Bundling Behavior for Circular Refs #510
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
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #510 +/- ##
=======================================
Coverage 99.52% 99.53%
=======================================
Files 191 191
Lines 23466 23478 +12
=======================================
+ Hits 23354 23368 +14
+ Misses 69 68 -1
+ Partials 43 42 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
also fixes an issue with panics in certain ref configurations |
|
two missing lines, you can do it! |
|
ahhhh! okay working on it! |
- Check root index for external schemas (idx != rootIdx) - Use SplitRefFragment for proper ref comparison - Handle both fragment and file-based circular refs - Add regression tests for both ref types - Preserves v0.25 behavior for local circular refs
Previously, we only checked circular refs for external schemas (idx != rootIdx), allowing local circular schemas to be partially inlined. This caused redundancy where schemas appeared both partially inlined at usage sites AND in components. Now we check circular refs for ALL schemas consistently, preventing partial inlining and keeping refs clean. This produces minimal output changes (hash updates only) while fixing the redundancy issue. Co-Authored-By: Claude <noreply@anthropic.com>
Remove unnecessary goto label and complex nil checks. Circular reference checking now uses simpler flow control while maintaining the same behavior: all schemas (local and external) are checked for circular references. - Remove goto/label construct - Simplify rolodex nil handling - Restore upstream code style (nope comments, double parens) - Revert test expectations to match upstream
Re-add the HTTP URL parsing logic that handles circular references in remotely loaded specs. This was inadvertently removed but is necessary for detecting circular refs when remote specs reference each other with relative paths. Keeps the SplitRefFragment logic added to fix external circular refs.
The error from PathItem.MarshalYAMLInline() was being discarded, causing a nil pointer panic when external path item references with local component refs failed to render. Properly propagate the error and handle nil rendered values.
…ror handling - Remove unreachable nil check (NodeBuilder.Render never returns nil) - Add test for error path when PathItem inline rendering fails - Achieves 100% coverage for MarshalYAMLInline
|
@daveshanley Fixed the coverage. I don't believe that the rendered variable can be nil so I removed it the check. I think it was just the missing error handler |
Lovely! |
Fixes a regression in the bundling behavior for circular refs with inline bundling where it wouldn't properly skip over recursive refs. Brings it closer to the original behavior.
More details in #508
Fixes #508