[BUG] [PHP] no data in container due to `$responseBody->getContents()`
Created by: cjprinse
Bug Report Checklist
-
☑ Have you provided a full/minimal spec to reproduce the issue? -
☑ Have you validated the input using an OpenAPI validator (example)? -
☑ What's the version of OpenAPI Generator used? -
☑ Have you search for related issues/PRs? -
☑ What's the actual output vs expected output?
Description
The method GuzzleHttp\Psr7\Stream::getContents
will not reset the stream to position 0.
So, when u are using middleware to intercept the response (eg guzzle profiler), getContents will return a empty value. As a consequence the data in the model container will be empty.pty.
openapi-generator version
v4.2.1
OpenAPI declaration file content or url
https://gist.github.com/cjprinse/4c5b5e2f5065fc3c24f0829c7448e640
Command line used for generation
npx openapi-generator generate -g php -o bundles/src/Etrias/Bundles/WarehouseBundle/Connector -i ~/swagger.json --skip-validate-spec --invoker-package=Etrias\\\\Bundles\\\\WarehouseBundle\\\\Connector\\\\lib
Suggest a fix
Use GuzzleHttp\Psr7\Stream::__toString
instead of GuzzleHttp\Psr7\Stream::getContents()