fix: rewrite composed refs inside extensions#602
Conversation
Composed bundles could leave root-level vendor extension `$refs` pointing at external files even when the referenced component had been composed into the bundle. Such refs made the bundled document not self-contained. Allow the final composed-ref rewrite pass to also process `$ref` values under `x-*` extension fields, and add a regression test. Spotted on our side once we upgraded to the latest vacuum version. In our case, we use extensions similarly to the included regression tests which stopped being properly composed. Related: pb33f@8585a05
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #602 +/- ##
=======================================
Coverage 99.75% 99.75%
=======================================
Files 281 281
Lines 34061 34096 +35
=======================================
+ Hits 33977 34012 +35
Misses 51 51
Partials 33 33
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:
|
|
Thank you for your contribution! one case that still leaves the composed bundle non-self-contained. The patch rewrites extension $refs when the complete target exactly matches an entry in processedNodes, but not when the ref points below a composed component. For example: x-related-field:
$ref: './models.yaml#/components/schemas/Thing/properties/id'If Could |
Composed bundles could leave root-level vendor extension
$refspointing at external files even when the referenced component had been composed into the bundle. Such refs made the bundled document not self-contained.Allow the final composed-ref rewrite pass to also process
$refvalues underx-*extension fields, and add a regression test.Spotted on our side once we upgraded to the latest vacuum version. In our case, we use extensions similarly to the included regression tests which stopped being properly composed.
Related: 8585a05