Open rost5000 opened 1 year ago
@rost5000 Fixed it here: https://github.com/micronaut-projects/micronaut-openapi/pull/1733
Just use official micronaut generator for java and kotlin by micronaut-opeanpi gradle or maven plugin from this repo: https://github.com/micronaut-projects/micronaut-openapi
Look to this guide: https://guides.micronaut.io/latest/micronaut-openapi-generator-server.html
Also, please describe problems and suggestions here: https://github.com/micronaut-projects/micronaut-openapi/issues
Bug Report Checklist
Description
I try to create RBAC authentication based on micronaut controller. The micronaut controller was generated from openapi spec. The generator ignores the scope of the
securitySchemes
. I expected the security scopes in@Secured
annotation. The generated file contains:@Secured({SecurityRule.IS_AUTHENTICATED})
, but expected annotations like:@Secured({"write", "read"})
openapi-generator version
OpenAPI declaration file content or url
Here is a link: https://github.com/rost5000/micronaut-server-openapi/blob/master/src/main/resources/openapi.yaml
Generation Details
Steps to reproduce
./gradlew clean build
Related issues/PRs
Suggest a fix
I suggest that openapi generator load scopes information from
/security
or/components/securitySchemes
I expect to see in generated controllers the scopes of the security, like@Secured("write", "admin")