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
  • #577
Closed
Open
Issue created Jul 16, 2018 by Administrator@rootContributor

[php-symfony] Generated Controller uses an undefined property

Created by: dimitriyremerov

Description

Controller does not have container property which is being accessed in the code. https://github.com/swagger-api/swagger-codegen/pull/6842 introduced access to container property of the BaseController. At this point Controller did not have container property anymore since the inheritance from the Base Symfony Controller was removed in https://github.com/swagger-api/swagger-codegen/pull/6615. These changes were incompatible and now any generated php-symfony code will fail should any exception be thrown down the stack and caught by the Controller. Example of an invalid Controller: https://github.com/OpenAPITools/openapi-generator/blob/master/samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/Controller.php#L149

openapi-generator version

3.2, 4.0, master

openapi declaration file content or url

Any swagger/openapi declaration file, example: https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml

Command line used for generation

java -jar openapi-generator.jar generate -i /api/swagger.yml -l php-symfony -o /src

Steps to reproduce

Any generated php-symfony code is invalid now and will fail should any exception be thrown.

  1. Generate any php-symfony code from any swagger configuration
  2. Throw an exception anywhere during the business logic execution.
Related issues/PRs

Issue introduced in: https://github.com/swagger-api/swagger-codegen/pull/6842 Related PR (removal of BaseController inheritance): https://github.com/swagger-api/swagger-codegen/pull/6615

Suggest a fix/enhancement

PR open: #578

Assignee
Assign to
Time tracking