-
Notifications
You must be signed in to change notification settings - Fork 764
Fixes #1129 - allOf fix for $$ref values #1130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #1129 - allOf fix for $$ref values #1130
Conversation
…. Added test for $$ref values, but left it as skipped because $$ref values aren't being attached during any test.
…al $$ref value, do not have one after the `allOf` plugin runs
… properties being in the result of `allOf`
…wagger-js into bug/1129-fix-allOf-ref-value
|
@shockey this solves oh-so-many issues, would love to see it merged |
|
Great fix - just saw this while following up on one of the linked issues! |
…nconti/swagger-js into owenconti-bug/1129-fix-allOf-ref-value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Added a test, for good measure.
I'll miss the $$ref being available, but IMO no data is better than unreliable data.
|
Okay, now it's ready 😄 Thanks @owenconti! |
Fixes #1129
Should also fix the following swagger-ui issues:
swagger-api/swagger-ui#2946
swagger-api/swagger-ui#3490
swagger-api/swagger-ui#3342
swagger-api/swagger-ui#3127
swagger-api/swagger-ui#3093
and possibly others...
Added a patch at the end of the
allOfplugin to make sure the original values for the definition are merged back into the result of theallOf. This includes the$$refvalue. For definitions that did not originally include$$refvalues, we make sure the result ofallOfdoes not have a$$refvalue.I wrote a test for the new functionality, but during test runs (any test, not just mine), the
$$refvalue that is set during therefsplugin, is not available on thepatchobject inside theallOfplugin.Once we get that figured out, then we should be able to remove the
skipfrom my new test.Here's a screenshot showing the fix in action in the UI project:
Before:
After: