-
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] update HTTP library to use Guzzle #1482
Comments
@wing328, I think that this is a great idea, but I would think that the effort should wait on guzzle making guzzle-service working with guzzle 6. At that point, it would just be a matter of converting the swagger specs to guzzle services. |
@jimmypuckett thanks for the tips. I'd a look at guzzle-service but couldn't find the spec it uses. I'll check with the owner to find out more about the service and its specification when the project becomes more mature. |
@wing328, ya it is not well documented. It was very nice back in guzzle 3 days. I am looking forward in them releasing the update for version 6. |
How about using HTTPlug instead? This a client abstraction and thus we avoid binding the implementation to a single library. HTTPlug already supports a range of adapters including Guzzle 5 and 6 as well a simple . @wing328: If you agree with that direction I would be interested in taking a stab at this. I think there is some value in the fact that the current |
@kasperg thanks for the suggestion to use HTTPlug. As you suggested, creating an abstract class is one way to do it (which is perfectly fine with me but some developers may not want the dependency on HTTPlug) Another way is to following Java's current approach to generate Which approach do you feel more comfortable implementing? |
I did not know about the Having thought about third party packages with implementations will not work. The |
Hi ! Do we have any update on the update to a newer version of Guzzle ? @wing328 |
@Babacooll I don't think anyone is working on that. Would you have time to contribute the update? What features do you plan to use in the latest version of Guzzle (6.2.2)? |
@wing328 I currently don't have time but I'll think about it. It's mostly for security purposes as the version 3 has not received any security fixes for ages. |
@wing328 guzzle 6 service is out there. We are interested in work on swagger client generation using guzzle 6 and guzzle service. do you have time too to work on this?. we will need help on where to start. do you have a gross estimation of how much it will take to us to implement this? i have seen there is a library to translate openapi spec to guzzle service definition but the project seems to be dead https://github.com/loco/swizzle thx in advance. |
@jimmypuckett https://github.com/swagger-api/swagger-codegen/blob/master/modules/swagger-codegen/src/main/resources/php/ApiClient.mustache is a good starting point. As you can see, it's still using cURL. Ideally one can replace it with another ApiClient.mustache that uses guzzle or HTTPlug, which already supports a range of adapters including Guzzle 5 and 6. |
I am working on it. Httplug looks like reasonable choice. I'll also use https://packagist.org/packages/guzzlehttp/psr7 for implementations of psr interfaces (Request, Response, etc). |
Thanks @baartosz If you need any help (e.g. testing) from the community, please let us know. |
@wing328 how are authentication methods usually tested? I can't really find anything in any of clients test suites. |
@baartosz We do have some security definitions defined covering HTTP basic, API key, OAuth in the fake petstore spec: https://github.com/swagger-api/swagger-codegen/blob/master/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml#L784 If you're looking for real endpoints that validates authentication setting, then we don't that at the moment. Our long time goal is to leverage one of the server stub generator to generate server side code with edge cases that are not covered by the Petstore server. |
I too am interested in Guzzle 6.x+ support. To be honest, I've never heard of a library called HttpPlug so it's not really convincing for me to use - looking at the GitHub stars I'm probably not the only one. |
PR by @baartosz merged into 2.3.0. |
We want to upgrade the HTTP library to use Guzzle, which is a very mature HTTP library with lots of features: https://github.com/guzzle/guzzle#guzzle-php-http-client
If you want to work on this and need help on where to start, please ping @wing328. Thanks!
The text was updated successfully, but these errors were encountered: