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❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #602 +/- ##
==========================================
+ Coverage 99.75% 99.76% +0.01%
==========================================
Files 281 283 +2
Lines 34061 34442 +381
==========================================
+ Hits 33977 34362 +385
+ Misses 51 49 -2
+ Partials 33 31 -2
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