Last active
January 27, 2017 11:49
-
-
Save ru-rocker/7c3e0442d53d2a2a293dc9d9137666e7 to your computer and use it in GitHub Desktop.
swagger configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dependency> | |
<groupId>io.springfox</groupId> | |
<artifactId>springfox-swagger2</artifactId> | |
<version>2.4.0</version> | |
</dependency> | |
<dependency> | |
<groupId>io.springfox</groupId> | |
<artifactId>springfox-swagger-ui</artifactId> | |
<version>2.4.0</version> | |
</dependency> | |
<dependency> | |
<groupId>org.webjars</groupId> | |
<artifactId>bootstrap</artifactId> | |
<version>3.3.5</version> | |
</dependency> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Configuration | |
@EnableSwagger2 | |
public class SwaggerConfig { | |
@Bean | |
public Docket api() { | |
return new Docket(DocumentationType.SWAGGER_2).select().apis(RequestHandlerSelectors.any()) | |
.paths(PathSelectors.regex("/api/.*")).build().apiInfo(apiInfo()); | |
} | |
private ApiInfo apiInfo() { | |
Contact contact = new Contact("ru-rocker", "www.ru-rocker.com", "ru.rocker81@gmail.com"); | |
ApiInfo apiInfo = new ApiInfo("ru-rocker", "ru-rocker REST API", "1", null, contact, "", ""); | |
return apiInfo; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment