Skip to content

Commit d4f0594

Browse files
author
Anand Rajneesh
committed
[#7] Swagger implementation
1 parent 7fb9ac1 commit d4f0594

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

pom.xml

+10
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,16 @@
4949
<artifactId>spring-boot-starter-log4j2</artifactId>
5050
<version>${spring.version}</version>
5151
</dependency>
52+
<dependency>
53+
<groupId>io.springfox</groupId>
54+
<artifactId>springfox-swagger2</artifactId>
55+
<version>2.7.0</version>
56+
</dependency>
57+
<dependency>
58+
<groupId>io.springfox</groupId>
59+
<artifactId>springfox-swagger-ui</artifactId>
60+
<version>2.7.0</version>
61+
</dependency>
5262
</dependencies>
5363

5464
<build>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package org.gluecoders.library.config;
2+
3+
import org.springframework.context.annotation.Bean;
4+
import org.springframework.context.annotation.Configuration;
5+
import springfox.documentation.builders.PathSelectors;
6+
import springfox.documentation.builders.RequestHandlerSelectors;
7+
import springfox.documentation.spi.DocumentationType;
8+
import springfox.documentation.spring.web.plugins.Docket;
9+
import springfox.documentation.swagger2.annotations.EnableSwagger2;
10+
/**
11+
* Created by Anand_Rajneesh on 6/13/2017.
12+
*/
13+
@Configuration
14+
@EnableSwagger2
15+
public class SwaggerConfig {
16+
17+
@Bean
18+
public Docket swaggerSpringMvcPlugin() {
19+
return new Docket(DocumentationType.SWAGGER_2)
20+
.select()
21+
.apis(RequestHandlerSelectors.any())
22+
.paths(PathSelectors.any())
23+
.build();
24+
}
25+
}

0 commit comments

Comments
 (0)