Last active
January 16, 2021 18:05
-
-
Save AmineLAHRIM/ee4d1daf90e97dcff3192ec554c024a1 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
// run the project | |
url/v2/api-docs | |
// swagger ui (don't forget slash at the end) | |
url/swagger-ui/ |
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
<!-- https://mvnrepository.com/artifact/io.springfox/springfox-boot-starter --> | |
<dependency> | |
<groupId>io.springfox</groupId> | |
<artifactId>springfox-boot-starter</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.ecomflutter.demo.config; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.Configuration; | |
import springfox.documentation.builders.RequestHandlerSelectors; | |
import springfox.documentation.spi.DocumentationType; | |
import springfox.documentation.spring.web.plugins.Docket; | |
@Configuration | |
public class SwaggerConfig { | |
@Bean | |
public Docket apiDocket(){ | |
Docket docket=new Docket(DocumentationType.SWAGGER_2) | |
//select all routes on | |
.select() | |
// on this package | |
.apis(RequestHandlerSelectors.basePackage("com.ecomflutter.demo")) | |
.build(); | |
return docket; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment