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
PHP Client doesn't seem to support anyOf with discriminator #10168
I have the below spec and the generated php client doesn't seem to handle the combination of anyOf and discriminator. I see a property DISCRIMINATOR in the generated models but they're all null.
I was able to reproduce this same issue with python, which appears to use a similar mustache template with a {{discriminator}} variable. Very probably affects all languages.
Activity
dordal commentedon Oct 13, 2020
I can confirm this is still an issue as of codegen 3.0.22, and appears to affect more than just PHP.
Running the above file with one of the debug flags on....
So you can see that swagger is parsing the discriminator, and it's even included in the schema for the
AnyOfExampleResponseObjectsItemsmodel:But the discriminator is still set to null in the generated PHP code:
Looking at the mustache template ( https://github.com/swagger-api/swagger-codegen/blob/master/modules/swagger-codegen/src/main/resources/php/model_generic.mustache ) it appears the
{{discriminator}}variable isn't getting set, which is resulting in a null value.I was able to reproduce this same issue with python, which appears to use a similar mustache template with a
{{discriminator}}variable. Very probably affects all languages.