Open bencromwell opened 10 months ago
thanks for reporting the issue
what about php-nextgen client generator? does it have the same issue?
thanks for reporting the issue
what about php-nextgen client generator? does it have the same issue?
It doesn't seem to.
Bug Report Checklist
Description
Had this issue in a generated client and was able to find that it's present in the example client code for the PetStore API.
https://github.com/OpenAPITools/openapi-generator/blob/master/samples/client/petstore/php/psr-18/lib/HeaderSelector.php#L38
The 2nd argument to HeaderSelector is a string.
If you look at the usages on it you'll find for example, https://github.com/OpenAPITools/openapi-generator/blob/master/samples/client/petstore/php/psr-18/lib/Api/StoreApi.php#L340
showing that it tries to pass an array as the 2nd argument to selectHeaders. This fails when you try to call any API method, with:
PHP Fatal error: Uncaught TypeError: <your namespace>\HeaderSelector::selectHeaders(): Argument #2 ($contentType) must be of type string, array given
openapi-generator version
Latest master
OpenAPI declaration file content or url
As per the generated sample in the project
Generation Details
Steps to reproduce
Generate the sample PetStore client with the PSR-18 library.
Related issues/PRs
Suggest a fix