Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #4541
Closed
Open
Issue created Nov 19, 2019 by Administrator@rootContributor

[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()

Assignee
Assign to
Time tracking