From 413911210fe51dfea73d02d0ab893dc41b78857e Mon Sep 17 00:00:00 2001 From: Ludy Date: Thu, 24 Apr 2025 11:41:26 +0200 Subject: [PATCH] Changes from Version 2.2.0 to 2.8.6 `org.springdoc:springdoc-openapi-starter-webmvc-ui` (#3400) # Description of Changes Please provide a summary of the changes, including: - What was changed - Why the change was made - Any challenges encountered Closes #3399 --- ## Checklist ### General - [ ] I have read the [Contribution Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md) - [ ] I have read the [Stirling-PDF Developer Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md) (if applicable) - [ ] I have read the [How to add new languages to Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md) (if applicable) - [ ] I have performed a self-review of my own code - [ ] My changes generate no new warnings ### Documentation - [ ] I have updated relevant docs on [Stirling-PDF's doc repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/) (if functionality has heavily changed) - [ ] I have read the section [Add New Translation Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md#add-new-translation-tags) (for new translation tags only) ### UI Changes (if applicable) - [ ] Screenshots or videos demonstrating the UI changes are attached (e.g., as comments or direct attachments in the PR) ### Testing (if applicable) - [ ] I have tested my changes locally. Refer to the [Testing Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md#6-testing) for more details. --------- Co-authored-by: Anthony Stirling <77850077+Frooodle@users.noreply.github.com> --- build.gradle | 2 +- .../SPDF/controller/api/pipeline/PipelineController.java | 2 +- .../controller/api/security/ValidateSignatureController.java | 3 ++- src/main/java/stirling/software/SPDF/model/api/PDFFile.java | 4 +++- src/main/resources/application.properties | 3 ++- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index 5c0bc9741..303f6fad9 100644 --- a/build.gradle +++ b/build.gradle @@ -506,7 +506,7 @@ dependencies { implementation "com.drewnoakes:metadata-extractor:2.19.0" implementation "commons-io:commons-io:2.19.0" - implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:2.2.0" + implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.6" //general PDF // https://mvnrepository.com/artifact/com.opencsv/opencsv diff --git a/src/main/java/stirling/software/SPDF/controller/api/pipeline/PipelineController.java b/src/main/java/stirling/software/SPDF/controller/api/pipeline/PipelineController.java index a7dd8a0ec..6df02f24d 100644 --- a/src/main/java/stirling/software/SPDF/controller/api/pipeline/PipelineController.java +++ b/src/main/java/stirling/software/SPDF/controller/api/pipeline/PipelineController.java @@ -51,7 +51,7 @@ public class PipelineController { this.postHogService = postHogService; } - @PostMapping("/handleData") + @PostMapping(value = "/handleData", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) public ResponseEntity handleData(@ModelAttribute HandleDataRequest request) throws JsonMappingException, JsonProcessingException { MultipartFile[] files = request.getFileInput(); diff --git a/src/main/java/stirling/software/SPDF/controller/api/security/ValidateSignatureController.java b/src/main/java/stirling/software/SPDF/controller/api/security/ValidateSignatureController.java index 4b4da4bdd..400bdf44a 100644 --- a/src/main/java/stirling/software/SPDF/controller/api/security/ValidateSignatureController.java +++ b/src/main/java/stirling/software/SPDF/controller/api/security/ValidateSignatureController.java @@ -22,6 +22,7 @@ import org.bouncycastle.cms.SignerInformationStore; import org.bouncycastle.cms.jcajce.JcaSimpleSignerInfoVerifierBuilder; import org.bouncycastle.util.Store; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.PostMapping; @@ -58,7 +59,7 @@ public class ValidateSignatureController { description = "Validates the digital signatures in a PDF file against default or custom" + " certificates. Input:PDF Output:JSON Type:SISO") - @PostMapping(value = "/validate-signature") + @PostMapping(value = "/validate-signature", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) public ResponseEntity> validateSignature( @ModelAttribute SignatureValidationRequest request) throws IOException { List results = new ArrayList<>(); diff --git a/src/main/java/stirling/software/SPDF/model/api/PDFFile.java b/src/main/java/stirling/software/SPDF/model/api/PDFFile.java index 685621904..930f9b0ff 100644 --- a/src/main/java/stirling/software/SPDF/model/api/PDFFile.java +++ b/src/main/java/stirling/software/SPDF/model/api/PDFFile.java @@ -6,10 +6,12 @@ import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; @Data +@NoArgsConstructor @EqualsAndHashCode public class PDFFile { - @Schema(description = "The input PDF file") + @Schema(description = "The input PDF file", format = "binary") private MultipartFile fileInput; } diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 9f58a93c6..d7d074223 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -39,5 +39,6 @@ server.servlet.session.timeout:30m springdoc.api-docs.path=/v1/api-docs # Set the URL of the OpenAPI JSON for the Swagger UI springdoc.swagger-ui.url=/v1/api-docs +springdoc.swagger-ui.path=/index.html posthog.api.key=phc_fiR65u5j6qmXTYL56MNrLZSWqLaDW74OrZH0Insd2xq -posthog.host=https://eu.i.posthog.com \ No newline at end of file +posthog.host=https://eu.i.posthog.com