You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Based off discussion in the spec in here and the Use Multiple Authentication Types section, I should be able to reuse authMethods in the security section of my path.
components:
securitySchemes:
myAuth:
type: oauth2flows:
authorizationCode:
scopes:
read: ability to readwrite: ability to writepet: ability on petpaths:
/petsget:
summary: get petssecurity:
- myAuth: [ read, pet ]
- myAuth: [ write, pet ] # if you can update we'll let you read too
Command line used for generation
The investigation has lead me to the generator, but I was reproducing this off of tests in SpringCodegenTest
Steps to reproduce
define oauth2 scopes in security schemes
use the same securityScheme on an api (with different scopes)
Eval the spring code generator
notice how we lose reference in the swagger annotations
the loops blindly put auth methods into the authMethods map by name even if the key exists. Maybe we need to consider accumulating collisions in the value and then iterate later in generation.
The text was updated successfully, but these errors were encountered:
Would love feedback on this since I am not sure of all the consideration it takes to make a deep generator change like this. I doubt the List<CodegenSecurity> authMethods in CodegenOperation will be able to represent the ORs, and I would like to add a new field that houses the actual auth requirements on a method.
Bug Report Checklist
Description
Based off discussion in the spec in here and the Use Multiple Authentication Types section, I should be able to reuse authMethods in the security section of my path.
openapi-generator version
Off master
OpenAPI declaration file content or url
https://github.com/nhomble/repro-multiple-authmethods
Command line used for generation
The investigation has lead me to the generator, but I was reproducing this off of tests in
SpringCodegenTest
Steps to reproduce
And this has caused issues for me in #6358
Suggest a fix
Debugging has brought us to the line
in
DefaultGenerator.java
the loops blindly put auth methods into the authMethods map by name even if the key exists. Maybe we need to consider accumulating collisions in the value and then iterate later in generation.
The text was updated successfully, but these errors were encountered: