-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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] fixed model_enum.mustache for real usage #11602
base: master
Are you sure you want to change the base?
Conversation
@77web thanks for the PR. Can you please follow step 3 in the PR checklist to update the samples? @jebentier (2017/07), @dkarlovi (2017/07), @mandrean (2017/08), @jfastnacht (2017/09), @ackintosh (2017/09) ❤️, @ybelenko (2018/07), @renepardon (2018/12) |
@wing328 Hi, thank you for your advice. Unfortunately, this PR is still work in progress. I'am now trying to find the best enum implementation for APIClients of PHP. So please wait for moment 🙏 |
No problem. Let us know if you need any help. |
@jebentier @dkarlovi @mandrean @jfastnacht @ackintosh @ybelenko @renepardon Could you review please? 🙇 |
Hello all,
Adopting the compromise solution would fix the issue, while still using this PR and allowing users to choose what model to use - and preserve the current behavior, avoiding the BC. 😄 I'm writing this as a heavy user of OpenAPIGenerator - we use it for dozens of API clients in our company. Accepting this PR as it is would definitely cause us a lot of harm, since we now and then need to recreate the clients (due to changes in the service APIs), and would have to check all of them (and their usage scenarios) for possible breaks. |
Hello again,
Which means, there will be an inconsistency between the objects in the request and in the response. This means, the "compromise" solution also needs to care about the
|
fixed Enum usage in PHP APIClients.
I tested actual API requests with this new EnumInterface, which performs API requests successfully 😄
before
after
note:
php8.1 has native Enum feature and it allows code like this.
But, many projects have not yet updated their environments to php8.1.
PR checklist
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*
.For Windows users, please run the script in Git BASH.
master
(5.3.0),6.0.x