You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The PHP SDK generator does not support deepObject parameters. This is mainly because of \GuzzleHttp\Psr7\Query::build(). When using a nested object build() will return an PHP notice and the object will be added as ?filter=Array instead of expected: ?filter[foo]=bar
PHP Notice: Array to string conversion in /vendor/guzzlehttp/psr7/src/Query.php on line 104
string(41) "?filter=Array"
openapi-generator version
latest dev-master
OpenAPI declaration file
An example which uses deepObject
- name: filterin: querydescription: Allows you to pass filtering options any attribute. `?filter[id]=123` or `?filter[author][like]=John`. Example of accessing nested array values `?filter[tags.alias]=food`required: falsestyle: deepObjectexplode: trueschema:
type: object
Suggest a fix
What is the reason to use \GuzzleHttp\Psr7\Query::build? Because with php's http_build_query the code would work.
If this is an accepted solution, i would like to provide a PR, maybe this could be at least introduced as an option... If there is something i miss, or there is a possibility to correctly build get URLs with deep object, please let me know. (Maybe i can also help document how to use deepObject) with the PHP SDK Generator.
Thanks for all the amazing work!
The text was updated successfully, but these errors were encountered:
Description
The PHP SDK generator does not support
deepObject
parameters. This is mainly because of\GuzzleHttp\Psr7\Query::build()
. When using a nested objectbuild()
will return an PHP notice and the object will be added as?filter=Array
instead of expected:?filter[foo]=bar
openapi-generator version
latest dev-master
OpenAPI declaration file
An example which uses
deepObject
Suggest a fix
What is the reason to use
\GuzzleHttp\Psr7\Query::build
? Because with php'shttp_build_query
the code would work.Query::build
and replace withhttp_build_query
from php, see https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/php/api.mustache#L671If this is an accepted solution, i would like to provide a PR, maybe this could be at least introduced as an option... If there is something i miss, or there is a possibility to correctly build get URLs with deep object, please let me know. (Maybe i can also help document how to use deepObject) with the PHP SDK Generator.
Thanks for all the amazing work!
The text was updated successfully, but these errors were encountered: