From 2d807eac48f0f5869832a6ec2f5ea56cdcae6f4d Mon Sep 17 00:00:00 2001 From: hirst Date: Wed, 5 Jun 2024 08:56:18 +0200 Subject: [PATCH] updated OpenAPIConfiguration.java and hopefully added cache --- .github/workflows/build_deploy_dev.yml | 1 + .../dummy/config/OpenAPIConfiguration.java | 34 +++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 dummy/src/main/java/com/learningpulse/dummy/config/OpenAPIConfiguration.java diff --git a/.github/workflows/build_deploy_dev.yml b/.github/workflows/build_deploy_dev.yml index 2e7e5b1..bc6bdfc 100644 --- a/.github/workflows/build_deploy_dev.yml +++ b/.github/workflows/build_deploy_dev.yml @@ -32,6 +32,7 @@ jobs: with: java-version: "22" distribution: "temurin" + cache: maven - name: Setup maven if: steps.maven-cache.outputs.cache-hit != 'true' diff --git a/dummy/src/main/java/com/learningpulse/dummy/config/OpenAPIConfiguration.java b/dummy/src/main/java/com/learningpulse/dummy/config/OpenAPIConfiguration.java new file mode 100644 index 0000000..afaae55 --- /dev/null +++ b/dummy/src/main/java/com/learningpulse/dummy/config/OpenAPIConfiguration.java @@ -0,0 +1,34 @@ +package com.learningpulse.dummy.config; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Contact; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.servers.Server; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.stereotype.Component; + +import java.util.List; + + +@Component +@Configuration +public class OpenAPIConfiguration { + @Bean + public OpenAPI gatewayOpenAPI() { + return new OpenAPI() + .servers( + List.of( + new Server().url("https://lpdev.4o1x5.dev").description("Development server") + ) + ) + .info(new Info() + .title("Learning Pulse API documentation") + .version("0.0.1") + .description("This is the API documentation for the dummy microservice.") + .contact(new Contact() + .name("Learning Pulse") + .url("https://git.4o1x5.dev/LearningPulse")) + ); + } +}