-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Swagger3 Authentication is not generated correctly #9843
Comments
For some reason part of the text I wrote was lost: Steps to reproduceRun commands from Command line section See src/gen/java/io/swagger/api/PetApi.java and search for scopes to see diff Note this is not only a template issue, scope group per operation isn't available Suggest a fix/enhancementIssues seems to have occurred as part of refactoring of processOperation function in DefaultGenerator.java |
might be duplicate of this defect |
has this issue been resolved .. i m trying to add OAuth2 scopes using OpenApi 3.0 but when the server stub is getting generated all the scopes are getting attached to all the operation functions. Using spring & java ? @lindgrenfredrik |
Haven't followed up this since we choose to move over to openapi gen instead which didn't exhibit this issue, so no clue if someone has fixed this issue in Swagger3 |
…ndpoint as a subset of the scopes defined in the `securitySchemes`.
…ndpoint as a subset of the scopes defined in the `securitySchemes`.
…#9843 on top of release 3.0.57, to be used until the actual bugfix is merged into the official repo.
#9786 ### Description
Swagger3 code generator has removed authMethod section for each Operation that was available in swagger2
There is a general AuthMethod section but for oauth2 it contains all scopes so it can't be used when generating scope checks for specific operations
Swagger-codegen version
Tested with 3.0.13 & 2.4.8 so see the difference
Swagger declaration file content or url
Swagger2 & 3 files to reproduce the problem:
https://gist.github.com/lindgrenfredrik/0eb76d8ee2cac7066bfefd914632a635
Command line used for generation
java -jar -DdebugOperations=True swagger-codegen-cli.jar generate -l jaxrs-resteasy -i pet_example_2_0.json -o tmp2
java -jar -DdebugOperations=True swagger-codegen-cli-3.0.13.jar generate -l jaxrs-resteasy -i pet_example_3_0.yaml -o tmp3
The text was updated successfully, but these errors were encountered: