-
Notifications
You must be signed in to change notification settings - Fork 6k
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
PHP Client doesn't seem to support anyOf with discriminator #10168
Comments
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
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 I was able to reproduce this same issue with python, which appears to use a similar mustache template with a |
Description
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.
Swagger-codegen version
3.0.18, not sure if it's a regression
Swagger declaration file content or url
Command line used for generation
I used brew to install codegen, command below:
swagger-codegen generate -i ./swagger-smol.yml -l php --config ./swagger-codegen/php-config.json -o ~/workspace/foo-client --git-user-id=foo --git-repo-id=foo
Steps to reproduce
Populate swagger-smol.yml with the above snippet and run the command above.
Related issues/PRs
I didn't find anything exactly like this but there are similar issues:
#4622
#3475
#4226
#4346
#3904
Suggest a fix/enhancement
Not sure...
The text was updated successfully, but these errors were encountered: