why openapi specification yaml generation forced to include basic security scheme ? #656
-
I was trying to generate a resource endpoint with bearer security scheme but the openapi specification yaml file generated with both basic and bearer schemes, it appears that basic security scheme is forced by default environment specifications
@Path("/api/v1/")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@SecurityScheme(scheme = "bearer",securitySchemeName = "bearerScheme",type = SecuritySchemeType.HTTP)
public class GreetingResource {
@GET
@Path("hello")
@SecurityRequirement(name = "bearerScheme")
public String hello() {
return "Hello from RESTEasy Reactive";
}
} openapi generated ---
openapi: 3.0.3
info:
title: openapi-demo API
version: 1.0.0-SNAPSHOT
paths:
/api/v1/hello:
get:
responses:
"200":
description: OK
content:
application/json:
schema:
type: string
security:
- bearerScheme: []
components:
securitySchemes:
SecurityScheme:
type: http
description: Authentication
scheme: basic
bearerScheme:
type: http
scheme: bearer is this the expected behaviour? is there any workaround to have only a specific single security scheme ? or any way to not have any security scheme? |
Beta Was this translation helpful? Give feedback.
Answered by
shreeram09
Sep 4, 2024
Replies: 1 comment 3 replies
-
I think this was a know issue, and has been fixed. Please try with a later version of Quarkus |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
found a workaround with properties based approach
quarkus.smallrye-openapi.auto-add-security=false
quarkus.smallrye-openapi.security-scheme-name=bearerAuth
quarkus.smallrye-openapi.security-scheme=jwt
this worked with