Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[php-symfony] Generated Controller uses an undefined property #8337

Open
dimitriyremerov opened this issue Jun 20, 2018 · 0 comments · May be fixed by #8338
Open

[php-symfony] Generated Controller uses an undefined property #8337

dimitriyremerov opened this issue Jun 20, 2018 · 0 comments · May be fixed by #8338

Comments

@dimitriyremerov
Copy link

dimitriyremerov commented Jun 20, 2018

Description

Controller does not have container property which is being accessed in the code.
#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 #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/swagger-api/swagger-codegen/blob/master/samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/Controller.php#L149

Swagger-codegen version

2.3.0, 2.3.1, master

Swagger declaration file content or url

Any swagger file, example: https://github.com/swagger-api/swagger-codegen/blob/master/modules/swagger-codegen/src/test/resources/2_0/petstore.yaml

Command line used for generation

java -jar swagger-codegen-cli.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: #6842
Related PR (removal of BaseController inheritance): #6615

Suggest a fix/enhancement

Fixed in #8338

@dimitriyremerov dimitriyremerov changed the title [php-symfony] Controller [php-symfony] Generated Controller uses an undefined property Jun 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant