[REST][Docs] Corrects the docs for security requirement for the ThingResource (in the openapi specification) (#2404)

* Add @SecurityRequirement annotation to ThingResource::getAll function

Signed-off-by: Paul Vogel <github@paulvogel.me>
pull/2410/head
Paul Vogel 2021-06-21 13:00:01 +02:00 committed by GitHub
parent 5cc76378a0
commit 1f2beea19e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -287,8 +287,9 @@ public class ThingResource implements RESTResource {
@GET
@RolesAllowed({ Role.ADMIN })
@Produces(MediaType.APPLICATION_JSON)
@Operation(operationId = "getThings", summary = "Get all available things.", responses = {
@ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = EnrichedThingDTO.class), uniqueItems = true))) })
@Operation(operationId = "getThings", summary = "Get all available things.", security = {
@SecurityRequirement(name = "oauth2", scopes = { "admin" }) }, responses = {
@ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = EnrichedThingDTO.class), uniqueItems = true))) })
public Response getAll(
@HeaderParam(HttpHeaders.ACCEPT_LANGUAGE) @Parameter(description = "language") @Nullable String language,
@QueryParam("summary") @Parameter(description = "summary fields only") @Nullable Boolean summary) {