fix: rewrite composed refs inside extensions - #602
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #602 +/- ##
==========================================
- Coverage 99.78% 99.75% -0.04%
==========================================
Files 283 283
Lines 34456 34478 +22
==========================================
+ Hits 34382 34393 +11
- Misses 46 56 +10
- Partials 28 29 +1
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 |
|
@daveshanley thanks, make sense! I tried to address it but I am not 100% confident I got it right, please let me know if additional adjustments are needed. |
|
Thanks, this addresses the nested-pointer case, and I verified the regression against current main. I found one remaining performance concern: A focused benchmark scales from ~0.40 µs at 100 nodes to ~40.7 µs at 10,000 nodes. Could we preserve the exact speed is everything. everything |
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
f82bb41 to
5ffbc29
Compare
5ffbc29 to
2e36ac2
Compare
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