From a5ee10e02936e6c1992a200a4b1d5d8e52167580 Mon Sep 17 00:00:00 2001 From: Anthony Stirling <77850077+Frooodle@users.noreply.github.com> Date: Sat, 30 Dec 2023 02:19:30 +0000 Subject: [PATCH 1/2] required flase --- .../SPDF/controller/api/pipeline/ApiDocService.java | 10 +++++++--- .../controller/api/pipeline/PipelineProcessor.java | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/stirling/software/SPDF/controller/api/pipeline/ApiDocService.java b/src/main/java/stirling/software/SPDF/controller/api/pipeline/ApiDocService.java index 3eda502b..c3bf9c8d 100644 --- a/src/main/java/stirling/software/SPDF/controller/api/pipeline/ApiDocService.java +++ b/src/main/java/stirling/software/SPDF/controller/api/pipeline/ApiDocService.java @@ -4,6 +4,7 @@ import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpEntity; import org.springframework.http.HttpHeaders; @@ -20,12 +21,14 @@ import jakarta.servlet.ServletContext; import stirling.software.SPDF.SPdfApplication; import stirling.software.SPDF.model.ApiEndpoint; import stirling.software.SPDF.model.Role; - +import org.slf4j.Logger; @Service public class ApiDocService { private final Map apiDocumentation = new HashMap<>(); + private static final Logger logger = LoggerFactory.getLogger(ApiDocService.class); + @Autowired private ServletContext servletContext; @@ -51,6 +54,7 @@ public class ApiDocService { //@EventListener(ApplicationReadyEvent.class) private synchronized void loadApiDocumentation() { + String apiDocsJson = ""; try { HttpHeaders headers = new HttpHeaders(); String apiKey = getApiKeyForUser(); @@ -61,7 +65,7 @@ public class ApiDocService { RestTemplate restTemplate = new RestTemplate(); ResponseEntity response = restTemplate.exchange(getApiDocsUrl(), HttpMethod.GET, entity, String.class); - String apiDocsJson = response.getBody(); + apiDocsJson = response.getBody(); ObjectMapper mapper = new ObjectMapper(); apiDocsJsonRootNode = mapper.readTree(apiDocsJson); @@ -78,7 +82,7 @@ public class ApiDocService { }); } catch (Exception e) { // Handle exceptions - e.printStackTrace(); + logger.error("Error grabbing swagger doc, body result {}", apiDocsJson); } } diff --git a/src/main/java/stirling/software/SPDF/controller/api/pipeline/PipelineProcessor.java b/src/main/java/stirling/software/SPDF/controller/api/pipeline/PipelineProcessor.java index 2fad339b..8b4b2ef4 100644 --- a/src/main/java/stirling/software/SPDF/controller/api/pipeline/PipelineProcessor.java +++ b/src/main/java/stirling/software/SPDF/controller/api/pipeline/PipelineProcessor.java @@ -49,7 +49,7 @@ public class PipelineProcessor { @Autowired private ApiDocService apiDocService; - @Autowired + @Autowired(required=false) private UserServiceInterface userService; @Autowired From b32c28e9cbf7743ba50b3961728cc0fe8026f4ea Mon Sep 17 00:00:00 2001 From: Anthony Stirling <77850077+Frooodle@users.noreply.github.com> Date: Sat, 30 Dec 2023 02:20:16 +0000 Subject: [PATCH 2/2] Update build.gradle --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index dd854e45..8002ee7a 100644 --- a/build.gradle +++ b/build.gradle @@ -8,7 +8,7 @@ plugins { } group = 'stirling.software' -version = '0.18.0' +version = '0.18.1' sourceCompatibility = '17' repositories {