OpenAPITools / openapi-generator

OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
https://openapi-generator.tech
Apache License 2.0
21.85k stars 6.59k forks source link

[BUG] kotlin-spring oauth does not work #6127

Open skhro87 opened 4 years ago

skhro87 commented 4 years ago

Bug Report Checklist

Description

I tried running the petstore.yaml example (that include oauth implicit security), but no oauth code is generated. I tried via npm cli and docker cli.

openapi-generator version

via docker I also tried v4.0.0 and v3.3.4 with no success

OpenAPI declaration file content or url

petstore.yaml 2.0 or petstore.yaml 3.0

Command line used for generation

docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli generate \ -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml \ -g kotlin-spring \ -o /local/web

Steps to reproduce
Related issues/PRs
Suggest a fix
auto-labeler[bot] commented 4 years ago

👍 Thanks for opening this issue! 🏷 I have applied any labels matching special text in your issue.

The team will review the labels and make any necessary changes.

skhro87 commented 4 years ago

If I use --additional-properties=swaggerAnnotations=true, it created oauth annotations, but there is no actual oauth functionality happening when I test the API. Am I understanding the openapi generator correctly, will it create oauth functionality or just annotations?

huehnerlady commented 4 years ago

I guess the correct approach here would be to generate Springs @PreAuthorize annotation for the scopes