Skip to content

Commit 26b9be7

Browse files
committed
improve OpenAPI response #11415
It looks like this now: /info/applicationTermsOfUse: get: tags: - info operationId: Info_getApplicationTermsOfUse parameters: - name: lang in: query description: Two-character language code. required: false schema: type: string example: en responses: "200": description: Application Terms of Use (General Terms of Use) that must be agreed to at signup.
1 parent 01f9dfa commit 26b9be7

File tree

1 file changed

+11
-1
lines changed
  • src/main/java/edu/harvard/iq/dataverse/api

1 file changed

+11
-1
lines changed

src/main/java/edu/harvard/iq/dataverse/api/Info.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
import jakarta.ws.rs.core.MediaType;
3131
import jakarta.ws.rs.core.Response;
3232
import org.eclipse.microprofile.openapi.annotations.Operation;
33+
import org.eclipse.microprofile.openapi.annotations.enums.SchemaType;
34+
import org.eclipse.microprofile.openapi.annotations.media.Schema;
35+
import org.eclipse.microprofile.openapi.annotations.parameters.Parameter;
3336
import org.eclipse.microprofile.openapi.annotations.responses.APIResponse;
3437
import org.eclipse.microprofile.openapi.annotations.tags.Tag;
3538

@@ -80,7 +83,14 @@ public Response getServer() {
8083

8184
@GET
8285
@Path("applicationTermsOfUse")
83-
public Response getApplicationTermsOfUse(@QueryParam("lang") String lang) {
86+
@APIResponse(responseCode = "200",
87+
description = "Application Terms of Use (General Terms of Use) that must be agreed to at signup.")
88+
public Response getApplicationTermsOfUse(
89+
@Parameter(description = "Two-character language code.",
90+
required = false,
91+
example = "en",
92+
schema = @Schema(type = SchemaType.STRING))
93+
@QueryParam("lang") String lang) {
8494
return ok(systemConfig.getApplicationTermsOfUse(lang));
8595
}
8696

0 commit comments

Comments
 (0)