From 44de9561395cc58108024c64f65bafb04357cdff Mon Sep 17 00:00:00 2001 From: Juan Pablo Tosca Villanueva Date: Fri, 25 Oct 2024 11:30:32 -0400 Subject: [PATCH] Adds an example of how to documment the requirement of security token for the OpenAPI --- src/main/java/edu/harvard/iq/dataverse/api/Access.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/edu/harvard/iq/dataverse/api/Access.java b/src/main/java/edu/harvard/iq/dataverse/api/Access.java index 16ac884180b..3504d5c431d 100644 --- a/src/main/java/edu/harvard/iq/dataverse/api/Access.java +++ b/src/main/java/edu/harvard/iq/dataverse/api/Access.java @@ -137,6 +137,7 @@ import org.eclipse.microprofile.openapi.annotations.parameters.RequestBody; import org.eclipse.microprofile.openapi.annotations.responses.APIResponse; import org.eclipse.microprofile.openapi.annotations.responses.APIResponses; +import org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement; import org.eclipse.microprofile.openapi.annotations.tags.Tag; import org.glassfish.jersey.media.multipart.FormDataBodyPart; import org.glassfish.jersey.media.multipart.FormDataParam; @@ -1269,6 +1270,7 @@ private String getWebappImageResource(String imageName) { }) @Tag(name = "saveAuxiliaryFileWithVersion", description = "Save Auxiliary File With Version") + @SecurityRequirement(name = "api_token") @RequestBody(content = @Content(mediaType = MediaType.MULTIPART_FORM_DATA)) public Response saveAuxiliaryFileWithVersion(@Context ContainerRequestContext crc, @PathParam("fileId") Long fileId,