Skip to content

Conversation

@ybelenko
Copy link
Contributor

PR checklist

  • Read the contribution guidelines.
  • Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh, ./bin/openapi3/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\.
  • Filed the PR against the correct branch: master, 3.4.x, 4.0.x. Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming language.

Description of the PR

Current generator requires AbstractAuthenticator user implementation when schema contains security definitions. When implementation class is provided app throws TypeError.

[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

Fixes #2640

cc @jebentier, @dkarlovi, @mandrean, @jfastnacht, @ackintosh, @ybelenko, @renepardon

@ybelenko ybelenko added this to the 4.0.0 milestone Apr 10, 2019
@ybelenko ybelenko changed the title [PHPSlim] Fix AbstractAuthenticator constructor TypeError [Slim] Fix AbstractAuthenticator constructor TypeError Apr 10, 2019
Copy link
Contributor

@ackintosh ackintosh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix. LGTM!

@wing328 wing328 merged commit c88b0a1 into OpenAPITools:master Apr 13, 2019
jimschubert added a commit that referenced this pull request Apr 13, 2019
* master: (47 commits)
  [Slim] Fix AbstractAuthenticator constructor TypeError (#2641)
  Fix issue 1340 - StaticHtmlGenerator to allow snake_case property names (#2612)
  Test Gradle plugin in Appveyor CI (#2651)
  Add Camptocamp to company list (#2652)
  Use percent encoding for path parameters (#2649)
  Unescape HTML characters in JS docstring (#2636)
  [ONLINE] Minor links fix (#2644)
  better handling of undefined inner property in array (#2635)
  Fix regexp error on php-slim (#2604)
  [TypeScript-Fetch] Generate oneOf schemas as type unions (#2617)
  Add Namsor as the sponsor (#2639)
  fix classname in website (#2638)
  Code review fixes (#2633)
  Move Ruby module/gem to codegen constant (#2621)
  Add sponsor section to the website (#2634)
  [Spring] Spotbugs static class and default encoding (#2609)
  Add @Zomzog (2019/04) to Java, Kotlin tech comm (#2630)
  [maven] remove validateSpec (#2614)
  Clean up the license field in various templates to ensure it's unlicense by default. (#2627)
  Fix NPE when server url is null (#2628)
  ...
@ybelenko ybelenko deleted the bug/2640 branch April 14, 2019 00:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] PHPSlim Auth middleware TypeError

3 participants