0b5f6227836c5479bbd6b5dab37d93d7d83069c9
[ccsdk/apps.git] /
1 /*\r
2  *  Copyright © 2017-2018 AT&T Intellectual Property.\r
3  *\r
4  *  Licensed under the Apache License, Version 2.0 (the "License");\r
5  *  you may not use this file except in compliance with the License.\r
6  *  You may obtain a copy of the License at\r
7  *\r
8  *      http://www.apache.org/licenses/LICENSE-2.0\r
9  *\r
10  *  Unless required by applicable law or agreed to in writing, software\r
11  *  distributed under the License is distributed on an "AS IS" BASIS,\r
12  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
13  *  See the License for the specific language governing permissions and\r
14  *  limitations under the License.\r
15  */\r
16 \r
17 package org.onap.ccsdk.apps.blueprintsprocessor;\r
18 \r
19 import org.slf4j.Logger;\r
20 import org.slf4j.LoggerFactory;\r
21 import org.springframework.context.annotation.Bean;\r
22 import org.springframework.context.annotation.ComponentScan;\r
23 import org.springframework.context.annotation.Configuration;\r
24 import org.springframework.web.bind.annotation.RequestMapping;\r
25 import springfox.documentation.builders.PathSelectors;\r
26 import springfox.documentation.builders.RequestHandlerSelectors;\r
27 import springfox.documentation.service.ApiInfo;\r
28 import springfox.documentation.service.Contact;\r
29 import springfox.documentation.spi.DocumentationType;\r
30 import springfox.documentation.spring.web.plugins.Docket;\r
31 import springfox.documentation.swagger2.annotations.EnableSwagger2;\r
32 \r
33 import java.util.Arrays;\r
34 import java.util.Collections;\r
35 import java.util.HashSet;\r
36 import java.util.Set;\r
37 \r
38 /**\r
39  * SwaggerConfig\r
40  *\r
41  * @author Brinda Santh 8/13/2018\r
42  */\r
43 @Configuration\r
44 @EnableSwagger2\r
45 public class SwaggerConfig {\r
46     private static final Set<String> DEFAULT_PRODUCES_AND_CONSUMES =\r
47             new HashSet<String>(Arrays.asList("application/json",\r
48                     "application/xml"));\r
49     private static Logger log = LoggerFactory.getLogger(SwaggerConfig.class);\r
50 \r
51     @Bean\r
52     public Docket api() {\r
53         return new Docket(DocumentationType.SWAGGER_2)\r
54                 .select()\r
55                 .apis(RequestHandlerSelectors.any())\r
56                 .paths(PathSelectors.any())\r
57                 .build()\r
58                 .apiInfo(apiInfo());\r
59     }\r
60 \r
61     private ApiInfo apiInfo() {\r
62         return new ApiInfo(\r
63                 "Blueprints Processor API",\r
64                 "Controller blueprints processor API for VNF Selfservice.",\r
65                 "1.0.0",\r
66                 "Terms of service",\r
67                 new Contact("Brinda Santh", "www.onap.com", "bs2796@onap.com"),\r
68                 "Apache 2.0", "http://www.apache.org/licenses/LICENSE-2.0", Collections.emptyList());\r
69     }\r
70 \r
71 \r
72 }\r