Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 2d15ca9

Browse files
added api docs with swagger2
1 parent e7b6490 commit 2d15ca9

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

‎pom.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,18 @@
4444
<artifactId>junit</artifactId>
4545
<scope>test</scope>
4646
</dependency>
47+
<dependency>
48+
<groupId>io.springfox</groupId>
49+
<artifactId>springfox-swagger-ui</artifactId>
50+
<version>2.6.1</version>
51+
<scope>compile</scope>
52+
</dependency>
53+
<dependency>
54+
<groupId>io.springfox</groupId>
55+
<artifactId>springfox-swagger2</artifactId>
56+
<version>2.6.1</version>
57+
<scope>compile</scope>
58+
</dependency>
4759
</dependencies>
4860

4961
<build>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package com.example.randombook;
2+
3+
import org.springframework.context.annotation.Bean;
4+
import org.springframework.context.annotation.Configuration;
5+
import springfox.documentation.builders.RequestHandlerSelectors;
6+
import springfox.documentation.spi.DocumentationType;
7+
import springfox.documentation.spring.web.plugins.Docket;
8+
import springfox.documentation.swagger2.annotations.EnableSwagger2;
9+
10+
import static springfox.documentation.builders.PathSelectors.regex;
11+
12+
@Configuration
13+
@EnableSwagger2
14+
public class SwaggerConfig {
15+
@Bean
16+
public Docket productApi() {
17+
return new Docket(DocumentationType.SWAGGER_2)
18+
.select()
19+
.apis(RequestHandlerSelectors.basePackage("com.example.randombook"))
20+
.build();
21+
22+
}
23+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /