From 0dc4f1f102c60520bd7c84592c50efc106d0e1e8 Mon Sep 17 00:00:00 2001 From: Maxim Date: Sat, 23 Mar 2024 18:55:20 +0300 Subject: [PATCH] Fix error code for profiles endpoints --- .github/workflows/purge-images.yml | 2 +- .../java/org/verapdf/rest/resources/ValidateResource.java | 4 ++-- src/main/resources/org/verapdf/rest/views/restclient.mustache | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/purge-images.yml b/.github/workflows/purge-images.yml index a7f2fcf2..e9004f5f 100644 --- a/.github/workflows/purge-images.yml +++ b/.github/workflows/purge-images.yml @@ -14,7 +14,7 @@ jobs: - name: Delete all PR containers older than a week uses: snok/container-retention-policy@v2 with: - image-names: verapdf-rest, rest + image-names: rest cut-off: 1 week ago UTC account-type: org org-name: veraPDF diff --git a/src/main/java/org/verapdf/rest/resources/ValidateResource.java b/src/main/java/org/verapdf/rest/resources/ValidateResource.java index 64cdf384..612f3eef 100644 --- a/src/main/java/org/verapdf/rest/resources/ValidateResource.java +++ b/src/main/java/org/verapdf/rest/resources/ValidateResource.java @@ -115,7 +115,7 @@ public static ComponentDetails getDetails() { @Content(mediaType = "text/html", schema = @Schema(implementation = BatchSummary.class)) }) }) @Consumes(MediaType.MULTIPART_FORM_DATA) @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON, MediaType.TEXT_HTML }) - public static Response validateXml( + public static Response validate( @Parameter(description = PARAM_PROFILE_DESC) @PathParam("profileId") String profileId, @Parameter(description = "the hex String representation of the file's SHA-1 hash", required = false, allowEmptyValue = true) @FormDataParam("sha1Hex") String sha1Hex, @Parameter(name = "file", schema = @Schema(implementation = File.class), style = ParameterStyle.FORM, description = "a PDF file uploaded to be validated") @FormDataParam("file") InputStream uploadedInputStream, @@ -139,7 +139,7 @@ public static Response validateXml( @Content(mediaType = "text/html", schema = @Schema(implementation = BatchSummary.class)) }) }) @Consumes(MediaType.MULTIPART_FORM_DATA) @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON, MediaType.TEXT_HTML }) - public static Response validateXml( + public static Response validate( @Parameter(description = PARAM_PROFILE_DESC) @PathParam("profileId") String profileId, @Parameter(description = "a URL that resolves to PDF resource to be validated") @FormDataParam("url") String urlLink, @Parameter(name = FILE_SIZE_HEADER, description = PARAM_FILE_SIZE_DESC) @HeaderParam(FILE_SIZE_HEADER) Integer fileSize, diff --git a/src/main/resources/org/verapdf/rest/views/restclient.mustache b/src/main/resources/org/verapdf/rest/views/restclient.mustache index 861e0d9f..f188370c 100644 --- a/src/main/resources/org/verapdf/rest/views/restclient.mustache +++ b/src/main/resources/org/verapdf/rest/views/restclient.mustache @@ -124,7 +124,7 @@

Disclaimer

-

This demo service is based on the offical veraPDF Docker image veraPDF/rest and is +

This demo service is based on the official veraPDF Docker image veraPDF/rest and is only intended to be used for testing. More details on the configuration of this service and tweaking its parameters for production use can be found at https://github.com/verapdf/verapdf-rest.

Supported validation profiles