Skip to content
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

With a composed model (allOf), only set the model which holds a discriminator field as parent #245

Closed
cbornet opened this issue May 19, 2016 · 1 comment

Comments

@cbornet
Copy link
Contributor

cbornet commented May 19, 2016

As per swagger spec's definition of allOf, inheritance should only be used in the case the parent model has a discriminator field.
The current implementation is to set the first model as parent but this results in issues with generated code (see swagger-api/swagger-codegen#2096)

@cbornet
Copy link
Contributor Author

cbornet commented May 19, 2016

After looking at the code, it seems difficult to do it in the parser because we only have the RefModel and not the ModelImpl and thus we don't know if it holds the discriminator.
So maybe allOf shouldn't set the parent at all and it should be done afterwards by the codegen for the interface that has the discriminator.

cbornet added a commit to cbornet/swagger-parser that referenced this issue May 19, 2016
cbornet added a commit to cbornet/swagger-parser that referenced this issue May 19, 2016
cbornet added a commit to cbornet/swagger-parser that referenced this issue May 19, 2016
cbornet added a commit to cbornet/swagger-parser that referenced this issue Jun 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant