Bug Report Checklist
Description
Current generator requires AbstractAuthenticator user implementation when schema contains security definitions. When implementation class is provided app throws TypeError.
openapi-generator version
4.0.0-SNAPSHOT
OpenAPI declaration file content or url
Any spec file file with secured endpoints can reproduce the bug.
https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
Command line used for generation
bin/php-slim-server-petstore.sh
Steps to reproduce
- Generate server stubs with any spec file with secured endpoints
- Make HTTP request to any secured endpoint
- App throws Exception with message
How about extending AbstractAuthenticator class by OpenAPIServer\\Auth\\OAuthAuthenticator?
- Overwrite
AbstractAuthenticator with your own OAuthAuthenticator class.
- Generate new Composer autoload with
composer dump-autoload
- Make the same HTTP request to any secured endpoint.
- App throws error
[10-Apr-2019 17:42:41 UTC] PHP Fatal error: Uncaught TypeError: Argument 1 passed to OpenAPIServer\Auth\AbstractAuthenticator::__construct()
must implement interface Psr\Container\ContainerInterface, array given, called in
/Applications/MAMP/htdocs/openapi-generator/samples/server/petstore/php-slim/lib/SlimRouter.php on line 650 and defined in
/Applications/MAMP/htdocs/openapi-generator/samples/server/petstore/php-slim/lib/Auth/AbstractAuthenticator.php:70
Suggest a fix
Will fix it myself.
Bug Report Checklist
Description
Current generator requires
AbstractAuthenticatoruser implementation when schema contains security definitions. When implementation class is provided app throws TypeError.openapi-generator version
4.0.0-SNAPSHOT
OpenAPI declaration file content or url
Any spec file file with secured endpoints can reproduce the bug.
https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
Command line used for generation
Steps to reproduce
AbstractAuthenticatorwith your ownOAuthAuthenticatorclass.composer dump-autoloadSuggest a fix
Will fix it myself.