Last active
October 23, 2022 18:54
-
-
Save EmmaG2/a9bda7d73c78190b35f4b2f685f0562f to your computer and use it in GitHub Desktop.
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-boot-starter</artifactId> | |
<version>3.0.0</version> | |
</dependency> | |
<dependency> | |
<groupId>io.springfox</groupId> | |
<artifactId>springfox-swagger-ui</artifactId> | |
<version>3.0.0</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
package com.ob.restapp.config; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.web.servlet.view.InternalResourceViewResolver; | |
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; | |
/** | |
* Configuracion Swagger para la config de la generacion | |
* de la documentacion | |
* | |
* @author Emma | |
*/ | |
@Configuration | |
public class SwaggerConfig { | |
@Bean | |
public Docket api() { | |
return new Docket(DocumentationType.SWAGGER_2) | |
.apiInfo(ApiInfo.DEFAULT) | |
.select() | |
.apis(RequestHandlerSelectors.any()) | |
.paths(PathSelectors.any()) | |
.build(); | |
} | |
@Bean | |
public InternalResourceViewResolver defaultViewResolver() { | |
return new InternalResourceViewResolver(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment