-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Inheritance using 'allOf' seems broken #3674
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
Comments
@owenconti, can you take a look at this? Sounds like it may be related to your recent |
Looking now. Since it's the enum values that aren't merging (an array), I think it's a bug with this earlier implementation of merging arrays: swagger-api/swagger-js#1101 |
Hi @HaraldNordgren - I believe I have a fix for this issue. The fix is in the |
@HaraldNordgren It's not a bug. |
@hkosova When using in production we did choose that work-around: To specify the combined enum in the parent instead. But the problems with inheritance are a bit deeper than that. As can be seen in the screenshot, the list in
but each property that exists in both children are taken only from the Norway model:
So if the Norway model has a description, that is the only thing that will be shown for the aggregrate model. |
@owenconti Thanks a bunch for giving this attention! Be aware that the issue is deeper than just the enum merging. The problem with |
@HaraldNordgren I'm sorry, but @hkosova is right. When we render I'm afraid there's nothing to fix here. @owenconti, your PR is not needed unfortunately. |
@webron @hkosova What should happen with nested Should
However, my PR also merges the |
It's a little bit tricky, but yes, both should be required. |
Locking due to inactivity. This is done to avoid resurrecting old issues and bumping long threads with new, possibly unrelated content. If you think you're experiencing something similar to what you've found here: please open a new issue, follow the template, and reference this issue in your report. Thanks! |
Problems with inheritance and overrides.
Demonstration API definition
Expected Behavior
I want 'Model' in the API definition to show the
enums
fields as a combination of the fields of its inherited definitions (SwedenBBANValidationResponse
andNorwayBBANValidationResponse
).And allow an
enums
specification on the parent to override the children if used.Current Behavior
Currently,
enums
shows values and description only from one of its children, seemingly arbitrarily chosen.There is no way to override the bleed-through by specifying a values on the parent.
Possible Solution
Context
The text was updated successfully, but these errors were encountered: