X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=main%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fapi%2Fmain%2Fconfig%2FSpringDocBean.java;fp=main%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fapi%2Fmain%2Fconfig%2FSwaggerConfig.java;h=6c471928caeaf14ebaea7aaf0bd3050952c9af7f;hb=555445562f24224ac5333b32345adff62f2c0c4c;hp=052ae5c6a62899260d729bd75d997131724bba4c;hpb=e5be0765d1f11dad136e4a81cf37bad481e26b0d;p=policy%2Fapi.git diff --git a/main/src/main/java/org/onap/policy/api/main/config/SwaggerConfig.java b/main/src/main/java/org/onap/policy/api/main/config/SpringDocBean.java similarity index 53% rename from main/src/main/java/org/onap/policy/api/main/config/SwaggerConfig.java rename to main/src/main/java/org/onap/policy/api/main/config/SpringDocBean.java index 052ae5c6..6c471928 100644 --- a/main/src/main/java/org/onap/policy/api/main/config/SwaggerConfig.java +++ b/main/src/main/java/org/onap/policy/api/main/config/SpringDocBean.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * Copyright (C) 2022 Bell Canada. All rights reserved. + * Copyright (C) 2021-2022 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,28 +20,29 @@ package org.onap.policy.api.main.config; +import io.swagger.v3.oas.models.ExternalDocumentation; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; 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.spi.DocumentationType; -import springfox.documentation.spring.web.plugins.Docket; -import springfox.documentation.swagger2.annotations.EnableSwagger2; @Configuration -@EnableSwagger2 -public class SwaggerConfig { +public class SpringDocBean { /** - * Create a bean of type Docket to determine the swagger configuration. - * @return docket bean with swagger configuration. + * Bean to configure Springdoc. + * + * @return the OpenAPI specification */ @Bean - public Docket api() { - return new Docket(DocumentationType.SWAGGER_2) - .select() - .apis(RequestHandlerSelectors.basePackage("org.onap.policy.api.main.rest")) - .paths(PathSelectors.any()) - .build(); + public OpenAPI policyFrameworkLifecycleOpenApi() { + return new OpenAPI() + .info(new Info().title("Policy Framework Lifecycle API") + .description("The Policy Framework API allows the lifecycle of policy types and policies to be managed") + .license(new License().name("Apache 2.0").url("http://www.apache.org/licenses/LICENSE-2.0"))) + .externalDocs(new ExternalDocumentation() + .description("Policy Framework Documentation") + .url("https://docs.onap.org/projects/onap-policy-parent/en/latest")); } -} \ No newline at end of file +}