From 97eafc7ff0a3057bd4649dca769172b92be89e80 Mon Sep 17 00:00:00 2001 From: "michele.artini" Date: Wed, 16 Nov 2022 10:41:55 +0100 Subject: [PATCH] fix after merge --- .../java/eu/dnetlib/is/MainApplication.java | 31 +++++++------------ 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/apps/dnet-is-application/src/main/java/eu/dnetlib/is/MainApplication.java b/apps/dnet-is-application/src/main/java/eu/dnetlib/is/MainApplication.java index ec356bb1..392264b5 100644 --- a/apps/dnet-is-application/src/main/java/eu/dnetlib/is/MainApplication.java +++ b/apps/dnet-is-application/src/main/java/eu/dnetlib/is/MainApplication.java @@ -1,20 +1,16 @@ package eu.dnetlib.is; +import org.springdoc.core.GroupedOpenApi; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cache.annotation.EnableCaching; +import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.scheduling.annotation.EnableScheduling; import eu.dnetlib.common.app.AbstractDnetApp; -import springfox.documentation.builders.ApiInfoBuilder; -import springfox.documentation.builders.RequestHandlerSelectors; -import springfox.documentation.service.ApiInfo; -import springfox.documentation.spring.web.plugins.Docket; -import springfox.documentation.swagger2.annotations.EnableSwagger2; @SpringBootApplication -@EnableSwagger2 @EnableCaching @EnableScheduling @ComponentScan(basePackages = "eu.dnetlib") @@ -24,20 +20,17 @@ public class MainApplication extends AbstractDnetApp { SpringApplication.run(MainApplication.class, args); } + @Bean + public GroupedOpenApi publicApi() { + return GroupedOpenApi.builder() + .group("D-Net Information Service API") + .pathsToMatch("/api/**") + .build(); + } + @Override - protected void configSwagger(final Docket docket) { - docket.select() - .apis(RequestHandlerSelectors.any()) - .paths(p -> p.contains("/api/")) - .build() - .apiInfo(new ApiInfoBuilder() - .title("D-Net Information Service APIs") - .description("APIs documentation") - .version("1.1") - .contact(ApiInfo.DEFAULT_CONTACT) - .license("Apache 2.0") - .licenseUrl("http://www.apache.org/licenses/LICENSE-2.0") - .build()); + protected String swaggerTitle() { + return "D-Net Information Service APIs"; } }