+++ /dev/null
-package de.spring.webservices.rest.doc;
-
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.servlet.config.annotation.EnableWebMvc;
-
-import springfox.documentation.builders.ApiInfoBuilder;
-import springfox.documentation.builders.PathSelectors;
-import springfox.documentation.builders.RequestHandlerSelectors;
-import springfox.documentation.service.ApiInfo;
-import springfox.documentation.spi.DocumentationType;
-import springfox.documentation.spring.web.plugins.Docket;
-import springfox.documentation.swagger.web.UiConfiguration;
-import springfox.documentation.swagger2.annotations.EnableSwagger2;
-
-@Configuration
-@EnableWebMvc
-@EnableSwagger2
-public class Swagger2Configuration {
- private static final String DOCKET_ID = "web-services-spring-rest";
-
- @Bean
- public Docket documentation() {
- return new Docket(DocumentationType.SWAGGER_2)
- .groupName(DOCKET_ID)
- .select()
- .apis(RequestHandlerSelectors.withMethodAnnotation(RequestMapping.class))
- .paths(PathSelectors.any())
- .build()
- .pathMapping("/")
- .useDefaultResponseMessages(false)
- .apiInfo(metadata())
- .enable(true);
- }
-
- @Bean
- UiConfiguration uiConfig() {
- return UiConfiguration.DEFAULT;
- }
-
-
- private static ApiInfo metadata() {
- return new ApiInfoBuilder()
- .title("gumartinm REST API")
- .description("Gustavo Martin Morcuende")
- .version("1.0-SNAPSHOT")
- .contact("gumartinm.name")
- .build();
- }
-
-}
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<beans xmlns="http://www.springframework.org/schema/beans"\r
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
- xmlns:context="http://www.springframework.org/schema/context"\r
- xmlns:util="http://www.springframework.org/schema/util"\r
- xsi:schemaLocation="http://www.springframework.org/schema/beans\r
- http://www.springframework.org/schema/beans/spring-beans.xsd\r
- http://www.springframework.org/schema/context\r
- http://www.springframework.org/schema/context/spring-context.xsd\r
- http://www.springframework.org/schema/util\r
- http://www.springframework.org/schema/util/spring-util.xsd">\r
-\r
- <!--\r
- \r
- Local deployment URLs:\r
- \r
- Swagger:\r
- http://localhost:8080/web-services-spring-rest/spring-rest/v2/api-docs?group=web-services-spring-rest\r
- \r
- Swagger-UI:\r
- http://localhost:8080/web-services-spring-rest/swagger-ui.html\r
- \r
- -->\r
-\r
- <bean class="de.spring.webservices.rest.doc.Swagger2Configuration"/>\r
-\r
-</beans>\r
+++ /dev/null
-package de.spring.webservices.rest.doc;
-
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.servlet.config.annotation.EnableWebMvc;
-
-import springfox.documentation.builders.ApiInfoBuilder;
-import springfox.documentation.builders.PathSelectors;
-import springfox.documentation.builders.RequestHandlerSelectors;
-import springfox.documentation.service.ApiInfo;
-import springfox.documentation.spi.DocumentationType;
-import springfox.documentation.spring.web.plugins.Docket;
-import springfox.documentation.swagger.web.UiConfiguration;
-import springfox.documentation.swagger2.annotations.EnableSwagger2;
-
-@Configuration
-@EnableWebMvc
-@EnableSwagger2
-public class Swagger2Configuration {
- private static final String DOCKET_ID = "web-services-spring-rest";
-
- @Bean
- public Docket documentation() {
- return new Docket(DocumentationType.SWAGGER_2)
- .groupName(DOCKET_ID)
- .select()
- .apis(RequestHandlerSelectors.withMethodAnnotation(RequestMapping.class))
- .paths(PathSelectors.any())
- .build()
- .pathMapping("/")
- .useDefaultResponseMessages(false)
- .apiInfo(metadata())
- .enable(true);
- }
-
- @Bean
- UiConfiguration uiConfig() {
- return UiConfiguration.DEFAULT;
- }
-
-
- private static ApiInfo metadata() {
- return new ApiInfoBuilder()
- .title("gumartinm REST API")
- .description("Gustavo Martin Morcuende")
- .version("1.0-SNAPSHOT")
- .contact("gumartinm.name")
- .build();
- }
-
-}
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<beans xmlns="http://www.springframework.org/schema/beans"\r
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
- xmlns:context="http://www.springframework.org/schema/context"\r
- xmlns:util="http://www.springframework.org/schema/util"\r
- xsi:schemaLocation="http://www.springframework.org/schema/beans\r
- http://www.springframework.org/schema/beans/spring-beans.xsd\r
- http://www.springframework.org/schema/context\r
- http://www.springframework.org/schema/context/spring-context.xsd\r
- http://www.springframework.org/schema/util\r
- http://www.springframework.org/schema/util/spring-util.xsd">\r
-\r
- <!--\r
- \r
- Local deployment URLs:\r
- \r
- Swagger:\r
- http://localhost:8080/web-services-spring-rest/spring-rest/v2/api-docs?group=web-services-spring-rest\r
- \r
- Swagger-UI:\r
- http://localhost:8080/web-services-spring-rest/swagger-ui.html\r
- \r
- -->\r
-\r
- <bean class="de.spring.webservices.rest.doc.Swagger2Configuration"/>\r
-\r
-</beans>\r