Skip to content

Commit

Permalink
[GlueCoders#7] Swagger implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
Anand Rajneesh committed Jun 13, 2017
1 parent 7fb9ac1 commit d4f0594
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,16 @@
<artifactId>spring-boot-starter-log4j2</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.7.0</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.7.0</version>
</dependency>
</dependencies>

<build>
Expand Down
25 changes: 25 additions & 0 deletions src/main/java/org/gluecoders/library/config/SwaggerConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package org.gluecoders.library.config;

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;
/**
* Created by Anand_Rajneesh on 6/13/2017.
*/
@Configuration
@EnableSwagger2
public class SwaggerConfig {

@Bean
public Docket swaggerSpringMvcPlugin() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.any())
.paths(PathSelectors.any())
.build();
}
}

0 comments on commit d4f0594

Please sign in to comment.