You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
With a composed model (allOf), only set the model which holds a discriminator field as parent #245
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)
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.
Activity
cbornet commentedon 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.
don't configure the parent with allOf
don't configure the parent with allOf
don't configure the parent with allOf
don't configure the parent with allOf