Commit 7c5f285b authored by Khalid Ali's avatar Khalid Ali
Browse files

Add Swagger for API documentation

parent 616d7e6c
......@@ -49,6 +49,8 @@ dependencies {
implementation('com.fasterxml.jackson.datatype:jackson-datatype-joda')
implementation('org.modelmapper:modelmapper:2.3.1')
compile('org.springframework.security:spring-security-cas')
compile('io.springfox:springfox-swagger2:2.9.2')
compile('io.springfox:springfox-swagger-ui:2.9.2')
compile('org.postgresql:postgresql:42.2.5')
compileOnly('org.projectlombok:lombok')
testImplementation('org.springframework.boot:spring-boot-starter-test')
......
package com.gmu.bookshare.utils;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
@Configuration
@EnableSwagger2
public class SwaggerConfig {
@Bean
public Docket api() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.any())
.paths(PathSelectors.any())
.build();
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment