From 3b406bb1d666c7f2b677bf77e137627377308fe2 Mon Sep 17 00:00:00 2001 From: Murilo Kakazu Date: Tue, 1 Oct 2024 00:12:09 -0300 Subject: [PATCH] fix: swagger base url --- .../configuration/SwaggerConfiguration.java | 18 ++++++++++++++++++ src/main/resources/application.properties | 3 +-- 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 src/main/java/br/com/fiap/grupo30/fastfood/infrastructure/configuration/SwaggerConfiguration.java diff --git a/src/main/java/br/com/fiap/grupo30/fastfood/infrastructure/configuration/SwaggerConfiguration.java b/src/main/java/br/com/fiap/grupo30/fastfood/infrastructure/configuration/SwaggerConfiguration.java new file mode 100644 index 0000000..1d4cc05 --- /dev/null +++ b/src/main/java/br/com/fiap/grupo30/fastfood/infrastructure/configuration/SwaggerConfiguration.java @@ -0,0 +1,18 @@ +package br.com.fiap.grupo30.fastfood.infrastructure.configuration; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.servers.Server; + +@Configuration +public class SwaggerConfiguration implements WebMvcConfigurer { + + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI() + .addServersItem(new Server().url("/test")); + } +} \ No newline at end of file diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 9cf30b1..eff7916 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -8,7 +8,6 @@ spring.profiles.active=dev spring.jpa.open-in-view=false # SWAGGER-UI CUSTOM PATH -springfox.documentation.swagger.v2.path=/test/swagger-resources -springfox.documentation.swagger-ui.base-url=/test/swagger-ui +springdoc.swagger-ui.path=/swagger-ui.html springdoc.swagger-ui.tagsSorter=alpha springdoc.swagger-ui.operationsSorter=alpha \ No newline at end of file