diff --git a/backend/console/pom.xml b/backend/console/pom.xml index 385e0c9f..e9d68ab7 100644 --- a/backend/console/pom.xml +++ b/backend/console/pom.xml @@ -37,26 +37,8 @@ spring-boot-starter-validation - io.springfox - springfox-boot-starter - - - swagger-models - io.swagger.core.v3 - - - swagger-annotations - io.swagger - - - swagger-annotations - io.swagger.core.v3 - - - swagger-models - io.swagger - - + org.springdoc + springdoc-openapi-ui diff --git a/backend/console/src/main/java/com/alibaba/higress/console/config/SwaggerConfig.java b/backend/console/src/main/java/com/alibaba/higress/console/config/SwaggerConfig.java index f23b3c5a..c2d1db81 100644 --- a/backend/console/src/main/java/com/alibaba/higress/console/config/SwaggerConfig.java +++ b/backend/console/src/main/java/com/alibaba/higress/console/config/SwaggerConfig.java @@ -12,31 +12,27 @@ */ package com.alibaba.higress.console.config; +import org.springdoc.core.GroupedOpenApi; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import springfox.documentation.builders.ApiInfoBuilder; -import springfox.documentation.builders.PathSelectors; -import springfox.documentation.builders.RequestHandlerSelectors; -import springfox.documentation.oas.annotations.EnableOpenApi; -import springfox.documentation.service.ApiInfo; -import springfox.documentation.service.Contact; -import springfox.documentation.spi.DocumentationType; -import springfox.documentation.spring.web.plugins.Docket; +import io.swagger.v3.oas.models.info.Contact; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; @Configuration -@EnableOpenApi public class SwaggerConfig { @Bean - public Docket docket() { - ApiInfo apiInfo = new ApiInfoBuilder().title("Higress Console") - .contact(new Contact("CH3CHO", "https://github.com/higress-group/higress-console", "ch3cho@qq.com")) + public GroupedOpenApi openApi() { + Info apiInfo = new Info().title("Higress Console") + .contact(new Contact().name("CH3CHO").url("https://github.com/higress-group/higress-console") + .email("ch3cho@qq.com")) .description( "Higress is a next-generation cloud-native gateway based on Alibaba's internal gateway practices.") - .license("Apache 2.0").licenseUrl("http://www.apache.org/licenses/LICENSE-2.0").build(); - return new Docket(DocumentationType.OAS_30).apiInfo(apiInfo).enable(true).select() - .apis(RequestHandlerSelectors.basePackage("com.alibaba.higress.console.controller")) - .paths(PathSelectors.any()).build().pathMapping("/"); + .license(new License().name("Apache 2.0").url("http://www.apache.org/licenses/LICENSE-2.0")); + return GroupedOpenApi.builder().group("Higress").displayName("Higress Console") + .addOpenApiCustomiser(openApi -> openApi.info(apiInfo)) + .packagesToScan("com.alibaba.higress.console.controller").build(); } } diff --git a/backend/pom.xml b/backend/pom.xml index 3f440e57..9b09df27 100644 --- a/backend/pom.xml +++ b/backend/pom.xml @@ -52,7 +52,6 @@ 17 - 3.0.0 2.9.0 31.1-jre 3.13.0 @@ -61,7 +60,6 @@ 17.0.0 1.46 - 2.1.21 3.20.0 1.12.1 @@ -71,6 +69,8 @@ 3.1.0 0.3.0 1.18.20.0 + 2.2.20 + 1.8.0 ${project.build.sourceEncoding} ${project.build.sourceEncoding} @@ -83,11 +83,6 @@ - - io.springfox - springfox-boot-starter - ${springfox.version} - com.google.guava guava @@ -129,9 +124,14 @@ ${retrofit.version} - io.swagger.parser.v3 - swagger-parser - ${swagger-parser.version} + org.springdoc + springdoc-openapi-ui + ${springdoc.version} + + + io.swagger.core.v3 + swagger-core + ${swagger-core.version} diff --git a/backend/sdk/pom.xml b/backend/sdk/pom.xml index 665c0243..a6f48ad6 100644 --- a/backend/sdk/pom.xml +++ b/backend/sdk/pom.xml @@ -29,8 +29,8 @@ - io.swagger.parser.v3 - swagger-parser + io.swagger.core.v3 + swagger-core com.alibaba