1 package de.spring.webservices.rest.doc;
3 import org.springframework.context.annotation.Bean;
4 import org.springframework.context.annotation.Configuration;
5 import org.springframework.web.bind.annotation.RequestMapping;
6 import org.springframework.web.servlet.config.annotation.EnableWebMvc;
8 import springfox.documentation.builders.ApiInfoBuilder;
9 import springfox.documentation.builders.PathSelectors;
10 import springfox.documentation.builders.RequestHandlerSelectors;
11 import springfox.documentation.service.ApiInfo;
12 import springfox.documentation.spi.DocumentationType;
13 import springfox.documentation.spring.web.plugins.Docket;
14 import springfox.documentation.swagger.web.UiConfiguration;
15 import springfox.documentation.swagger2.annotations.EnableSwagger2;
20 public class Swagger2Configuration {
21 private static final String DOCKET_ID = "web-services-spring-rest";
24 public Docket documentation() {
25 return new Docket(DocumentationType.SWAGGER_2)
28 .apis(RequestHandlerSelectors.withMethodAnnotation(RequestMapping.class))
29 .paths(PathSelectors.any())
32 .useDefaultResponseMessages(false)
38 UiConfiguration uiConfig() {
39 return UiConfiguration.DEFAULT;
43 private static ApiInfo metadata() {
44 return new ApiInfoBuilder()
45 .title("gumartinm REST API")
46 .description("Gustavo Martin Morcuende")
47 .version("1.0-SNAPSHOT")
48 .contact("gumartinm.name")