From 2791db21e7d7f7d31ea402fe978dab216a41367f Mon Sep 17 00:00:00 2001 From: Alexis de Talhouët Date: Sun, 23 Jun 2019 15:30:36 -0400 Subject: Fix swagger definition for blueprint processor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I69ba541b4b301735a988cf01673827a79daf1f8c Issue-ID: CCSDK-1431 Signed-off-by: Alexis de Talhouët --- .../cds/blueprintsprocessor/SwaggerConfig.java | 38 +++++++++++----------- .../ccsdk/cds/blueprintsprocessor/WebConfig.java | 7 ++-- 2 files changed, 23 insertions(+), 22 deletions(-) (limited to 'ms/blueprintsprocessor/application/src') diff --git a/ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/cds/blueprintsprocessor/SwaggerConfig.java b/ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/cds/blueprintsprocessor/SwaggerConfig.java index 8ad3c08f2..4df55ffde 100644 --- a/ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/cds/blueprintsprocessor/SwaggerConfig.java +++ b/ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/cds/blueprintsprocessor/SwaggerConfig.java @@ -17,8 +17,9 @@ package org.onap.ccsdk.cds.blueprintsprocessor; - +import io.swagger.annotations.Api; import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; import springfox.documentation.builders.PathSelectors; import springfox.documentation.builders.RequestHandlerSelectors; import springfox.documentation.service.ApiInfo; @@ -27,37 +28,36 @@ import springfox.documentation.spi.DocumentationType; import springfox.documentation.spring.web.plugins.Docket; import java.util.Collections; +import springfox.documentation.swagger2.annotations.EnableSwagger2WebFlux; /** * SwaggerConfig * * @author Brinda Santh 8/13/2018 */ -//@Configuration -//@EnableSwagger2 -@SuppressWarnings("unused") -@Deprecated +@Configuration +@EnableSwagger2WebFlux public class SwaggerConfig { @Bean public Docket api() { return new Docket(DocumentationType.SWAGGER_2) - .select() - .apis(RequestHandlerSelectors.any()) - .paths(PathSelectors.any()) - .build() - .apiInfo(apiInfo()); + .select() + .apis(RequestHandlerSelectors.withClassAnnotation(Api.class)) + .paths(PathSelectors.any()) + .build() + .apiInfo(apiInfo()); } private ApiInfo apiInfo() { return new ApiInfo( - "Blueprints Processor API", - "Controller blueprints processor API for VNF Selfservice.", - "1.0.0", - "Terms of service", - new Contact("Brinda Santh", "www.onap.com", "bs2796@onap.com"), - "Apache 2.0", "http://www.apache.org/licenses/LICENSE-2.0", Collections.emptyList()); + "CDS Blueprints Processor APIs", + "Provide APIs to interact with CBA, their related resolved resources and templates.", + "0.5.0", + null, + new Contact("CCSDK Team", "www.onap.org", "onap-discuss@lists.onap.org"), + "Apache 2.0", + "http://www.apache.org/licenses/LICENSE-2.0", + Collections.emptyList()); } - - -} +} \ No newline at end of file diff --git a/ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/cds/blueprintsprocessor/WebConfig.java b/ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/cds/blueprintsprocessor/WebConfig.java index b453b8581..32abff011 100644 --- a/ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/cds/blueprintsprocessor/WebConfig.java +++ b/ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/cds/blueprintsprocessor/WebConfig.java @@ -27,7 +27,7 @@ import org.springframework.security.config.web.server.ServerHttpSecurity; import org.springframework.security.web.server.SecurityWebFilterChain; import org.springframework.web.reactive.config.CorsRegistry; import org.springframework.web.reactive.config.ResourceHandlerRegistry; -import org.springframework.web.reactive.config.WebFluxConfigurationSupport; +import org.springframework.web.reactive.config.WebFluxConfigurer; /** * WebConfig @@ -35,7 +35,7 @@ import org.springframework.web.reactive.config.WebFluxConfigurationSupport; * @author Brinda Santh 8/13/2018 */ @Configuration -public class WebConfig extends WebFluxConfigurationSupport { +public class WebConfig implements WebFluxConfigurer { @Autowired private AuthenticationManager authenticationManager; @@ -45,7 +45,8 @@ public class WebConfig extends WebFluxConfigurationSupport { @Override public void addResourceHandlers(ResourceHandlerRegistry registry) { - registry.addResourceHandler("swagger-ui.html") + + registry.addResourceHandler("/swagger-ui.html**") .addResourceLocations("classpath:/META-INF/resources/"); registry.addResourceHandler("/webjars/**") -- cgit 1.2.3-korg