Skip to content

Codegen operation scopes inconsistency #1610

@ghost

Description

Description

Operation auth method scopes in template currently hold all defined scopes for specific security definition.
Swagger 2.* populates the list only with scopes defined for that particular operation.

Example:
If operation1 requires scope:op1, but there's also scope:op2 defined globally, then

-- operation1 context
...{{#authMethods}}{{#scopes}}{{scope}}, {{/scopes}}{{/authMethods}}..

swagger codegen produces

scope:op1, 

openapi generator produces

scope:op1, scope:op2, 

This issue was mentioned before in #1043.

Is this change intended? It's neven been questioned in that issue.
I could find that ada server generator fixes it at higher level (#1044), but shouldn't it be responsibility of base codegen?
Is there a more direct way for a template to access scopes required only by operation itself?

openapi-generator version

3.3.4

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions