Repository navigation
fix(bundler): compose only reachable external fragments - #741
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #741 +/- ##
==========================================
Coverage 100.00% 100.00%
==========================================
Files 324 325 +1
Lines 41641 41784 +143
==========================================
+ Hits 41641 41784 +143
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
daveshanley
marked this pull request as ready for review
November 29, 2026 22:46
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #734.
Importing
/pets/optionsalso pulled in an integerIdreferenced only by/petsin the same file. That component took the nameIdand forced the UUID used by/docs/{id}to becomeId__schemas.Behaviour changes
$refvalues and discriminator mappings from the selected external fragment. They include schemas reached only by a mapping, including through a root-local pointer or another mapping. Relative targets resolve against the file that declares them.StrictValidationenabled, OpenAPI 3.0 sibling checks apply to reachable references.Verification
The regression suite builds fresh models for
BundleDocumentComposedandBundleDocumentComposedWithOrigins, then parses the output as a standalone document. It covers the six-file report, multiple fragments in one file, mapping chains, relative targets with the same spelling, collisions, origins, and reusable components with OpenAPI keywords as names. Both byte-based entry points also run the unused-fragment and discriminator case with strict validation.The full Go suite passed with network fixtures enabled. The bundler has 100% statement coverage. The bundler race tests and
go vet ./bundleralso passed.In a local composition benchmark, the six-file case allocated 57.6 KiB per operation, down from 70.3 KiB on
main. The existing collision fixture allocated 571.6 KiB, up from 565.4 KiB. Six samples per revision showed no statistically significant runtime difference for either fixture.