Skip to content

Extending a resource class loses OpenAPI security scheme when generated #40839

Open

Description

Describe the bug

When a resource extends an abstract class it will generate the OpenAPI methods but loses the security scheme.

components:
  securitySchemes:
    SecurityScheme:
      type: http
      description: Authentication
      scheme: bearer
      bearerFormat: Opaque

Expected behavior

An extended resource extends the security scheme

  /goodbye:
    get:
      tags:
      - Regular Resource
      responses:
        "200":
          description: OK
          content:
            text/plain:
              schema:
                type: string
        "403":
          description: Not Allowed
        "401":
          description: Not Authorized
      security:
      - SecurityScheme: []

Actual behavior

The security scheme is missing from the generated OpenAPI spec.

  /hello:
    get:
      tags:
      - Extended Resource
      responses:
        "200":
          description: OK
          content:
            text/plain:
              schema:
                type: string

How to Reproduce?

1 . Run mvn install
2. See the target/openapi.yml

code-with-quarkus.zip

Output of uname -a or ver

No response

Output of java -version

21

Quarkus version or git rev

3.10.2

Build tool (ie. output of mvnw --version or gradlew --version)

Maven 3.9

Additional information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions