Update $ref references in metadata when parameterizing#4031
Conversation
Does the PR have any schema changes?Looking good! No breaking changes found. |
danielrbradley
left a comment
There was a problem hiding this comment.
Why are we using the approach of serializing then doing the matching on the string rather than iterating through the objects and replacing the values within the objects? Have you tried recursing through the objects to do the ref replacement?
I can't immediately see why this should break with the strings, but I'm also not super-confident that there wouldn't be some case where it doesn't work.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4031 +/- ##
==========================================
+ Coverage 57.85% 57.88% +0.03%
==========================================
Files 83 83
Lines 13391 13422 +31
==========================================
+ Hits 7747 7769 +22
- Misses 5045 5051 +6
- Partials 599 602 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
The string approach is not elegant but
To avoid these downsides, we could use a generic walker based on reflection that visits every property. But that's no safer than string replacement and probably slower as well. |
bd10d55 to
8914ce9
Compare
danielrbradley
left a comment
There was a problem hiding this comment.
Happy with the rationalization 👍
|
This PR has been shipped in release v2.89.2. |
This fixes an omission in #4010. Metadata contains
$ref's that need to be updated when parameterizing because all the tokens change, like in the schema.This fixes this error I had brought up elsewhere: