openapi-generator icon indicating copy to clipboard operation
openapi-generator copied to clipboard

[BUG] [java-micronaut-server] security annotation always @Secured({SecurityRule.IS_AUTHENTICATED})

Open menesty opened this issue 2 years ago • 1 comments

Description

Have configures security for endpoint but code always generate with annotation @Secured({SecurityRule.IS_AUTHENTICATED})

expected with annotation @Secured({"client")

Micronaut version 4.1.0

openapi-generator version

7.0.0

OpenAPI declaration file content or url

openapi: 3.0.0 info: title: Client Service API description: Business response for management companies, places, menus API. contact: name: test url: test email: test version: 1.0.0 security:

  • BearerAuth:
    • client
    • ADMIN paths: /v1/me: get: security:
      • BearerAuth: [ client ] tags:
      • serviceAccount operationId: me summary: Return list of accessed account responses: "200": description: Return list of accessed account content: application/json: schema: type: array uniqueItems: true items: type: string "401": description: Unauthorized.

menesty avatar Sep 08 '23 09:09 menesty

@menesty 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

altro3 avatar Aug 27 '24 06:08 altro3