I am using JWT Bearer token for authorization. I have added common authorization in SWAGGER UI which is working fine. But API level authorization RequestHeader is still showing in swagger UI. How can I hide it. Please refer to image 1.
Controller Code
@SecurityRequirement(name = "my-notes-api")
@Operation(description = "Update the existing note",
summary = "Update Note",
tags = "Notes")
@PutMapping(path = "/update-note",
consumes = MediaType.APPLICATION_JSON_VALUE,
produces = MediaType.APPLICATION_JSON_VALUE)
public Notes updateNote(@RequestHeader("Authorization") String authToken,
@RequestHeader("note-id") String noteId,
@RequestBody @Valid NotePOJO note) throws BusinessException {
return notesService.updateNote(jwtUtils.extractUserId(authToken.substring(7)), noteId, note);
}
I can not remove @RequestHeader("Authorization") String authToken from controller parameters as I am fetching the userId from this token only.