-
-
Notifications
You must be signed in to change notification settings - Fork 202
Closed
Labels
Milestone
Description
I have the following controller annonated as follows
@SecurityScheme(
name = "myBearerToken",
type = SecuritySchemeType.HTTP,
scheme = "bearer",
bearerFormat = "JWT",
in = SecuritySchemeIn.HEADER)
public class UserApi {
....
@GET("/{id}")
@Operation(
summary = "Find a user by ID",
description = "Finds a user by ID or throws a 404"
)
@SecurityRequirement(name = "myBearerToken", scopes = "user:read")
public User getUser(@PathParam String id) {
....
}
}
In the generated yaml file, I have
paths:
/public-api/user/{id}:
get:
tags:
- User
summary: Find a user by ID
description: Finds a user by ID or throws a 404
operationId: getUser
parameters:
- name: id
in: path
required: true
schema:
type: string
responses:
"200":
description: Success
content:
application/json:
schema:
type: object
additionalProperties:
type: object
security:
- myBearerToken:
- user:read
The @SecurityScheme is not generated and added to the components section in the yaml file as described in open api.
components:
...
securitySchemes:
myBearerToken:
type: http
scheme: bearer
bearerFormat: JWT
in: header