-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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] Allows setting extra request options via config #11431
base: master
Are you sure you want to change the base?
Conversation
👍 This is something I'm just in the need of and I'm looking forward to it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basic unit test from me.
vendor/bin/phpunit tests/ConfigurationTest.php
PHPUnit 9.5.10 by Sebastian Bergmann and contributors.
..... 5 / 5 (100%)
Time: 00:00.009, Memory: 6.00 MB
I'm 👎 on this change since it pushes us away from the actual solution we want, which is replaceable HTTP client. We're allowing to pass options to the HTTP client when we could pass the whole HTTP client which is preconfigured with those options, making the code here more complex. It's opposite of IoC, we're binding ourselves more tightly with the client by adding methods to configure it. |
@dkarlovi Unless I am mistake, the current setup does not permit a user from setting additional options, at all. Seems that allowing a user to do so while decoupling the generated SDK from whatever request library a user wants to use would be a much larger lift than a simple PR. Possibly a BC-break. |
Allows setting extra headers in request. One use case is setting xdebug cookie for debugging locally.
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
@jebentier @dkarlovi @mandrean @jfastnacht @ackintosh @ybelenko @renepardon