-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
[REQ][PHP] Bump guzzle to version 7 #7869
Comments
One way is to use customized templates (CLI options: |
Hi, same question: Would the generated client be compatible with guzzle 7? |
+1, have users affected by this issue. |
PR already exists but fails 1 test: #7950 |
+1 here as well, with our users being affected. |
+1 as one of the users @jason-o-matic is referring to :) |
Is there any update on this? |
Hi, it can be easly fixied by adding a custom composer template Just create a {
"name": "{{gitUserId}}/{{gitRepoId}}",
{{#artifactVersion}}
"version": "{{artifactVersion}}",
{{/artifactVersion}}
"description": "{{{appDescription}}}",
"keywords": [
"openapitools",
"openapi-generator",
"openapi",
"php",
"sdk",
"rest",
"api"
],
"homepage": "https://openapi-generator.tech",
"license": "unlicense",
"authors": [
{
"name": "OpenAPI-Generator contributors",
"homepage": "https://openapi-generator.tech"
}
],
"require": {
"php": ">=7.3",
"ext-curl": "*",
"ext-json": "*",
"ext-mbstring": "*",
"guzzlehttp/guzzle": "^6.2 || ^7.0"
},
"require-dev": {
"phpunit/phpunit": "^7.4",
"friendsofphp/php-cs-fixer": "^2.12"
},
"autoload": {
"psr-4": { "{{escapedInvokerPackage}}\\" : "{{srcBasePath}}/" }
},
"autoload-dev": {
"psr-4": { "{{escapedInvokerPackage}}\\Test\\" : "{{testBasePath}}/" }
}
} And then use this template when building the API by adding
|
If you do this, don't forget to add |
Shouldn't we make it guzzle agnostic? |
As far as I understand, the deprecated status functions from guzzle/psr7 ^1.8 have been listed here with their guzzle/psr7 ^2.0 equivalents: https://github.com/guzzle/psr7/tree/2.0.0#upgrading-from-function-api This is needed anyways to fix another bug handling ObjectSerialization of boolean query vars #2204. |
Worth noting that with Guzzle 7.3, you will get an error:
build_query() has been deprecated in favor of So https://github.com/OpenAPITools/openapi-generator/blob/5d68bd6a03f0c48e838b4fe3b98b7e30858c0373/modules/openapi-generator/src/main/resources/php/api.mustache will need to be updated to support Guzzle 7.3 (Line 610 and 663) |
@jeffski can you please submit a PR with the suggested fix when you've time? Thank you. |
Hi there, Also another side note to deprecated function being in the code, there is also a reference in https://github.com/OpenAPITools/openapi-generator/blob/5d68bd6a03f0c48e838b4fe3b98b7e30858c0373/modules/openapi-generator/src/main/resources/php/api.mustache line 563 to As I said PR should be coming in a few days so @jeffski should be off the hook ;) |
Please pull the latest master to give it a try. Thank you @heissb2342 for his contributions 👍 |
I have built a lib for others to use and it's using guzzle version 6.x b/c that's what openapi-generator uses. When other devs are consuming my project they are unable to use guzzle 7 since version 6 is what's being used in my lib generated from openapi-generator.
I come from node.js for the 8 years so i'm used to all of a projects dependencies using their own versions, but I guess php land is not like this.
Can you bump guzzle to version to 7? Or is there another way to handle this dependency of a dependency issue that i'm unaware of?
The text was updated successfully, but these errors were encountered: