Skip to content

Commit d927057

Browse files
committed
feat: add API swagger
- API swagger 이용을 위한 springdoc 의존성 추가 - application.yml에 springdoc 설정 추가 - http://~~~~~~/api-docs url로 접근 가능 - 유저 관련 기능 개발후 접근 권한 설정 예정
1 parent 9bc0f47 commit d927057

File tree

2 files changed

+34
-3
lines changed

2 files changed

+34
-3
lines changed

build.gradle

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,29 @@ repositories {
2424
}
2525

2626
dependencies {
27+
28+
// Data Layer: JPA, Redis, Database Drivers
2729
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
2830
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
31+
runtimeOnly 'com.h2database:h2'
32+
runtimeOnly 'com.mysql:mysql-connector-j'
33+
34+
// OAuth & Security
2935
implementation 'org.springframework.boot:spring-boot-starter-oauth2-authorization-server'
3036
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'
3137
implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server'
3238
implementation 'org.springframework.boot:spring-boot-starter-security'
39+
40+
// Web Layer
3341
implementation 'org.springframework.boot:spring-boot-starter-web'
42+
43+
// Utility
3444
compileOnly 'org.projectlombok:lombok'
35-
runtimeOnly 'com.h2database:h2'
36-
runtimeOnly 'com.mysql:mysql-connector-j'
3745
annotationProcessor 'org.projectlombok:lombok'
46+
implementation group: 'org.springdoc', name: 'springdoc-openapi-starter-webmvc-ui', version: '2.6.0'
47+
48+
49+
//test
3850
testImplementation 'org.springframework.boot:spring-boot-starter-test'
3951
testImplementation 'org.springframework.security:spring-security-test'
4052
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'

src/main/resources/application.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,23 @@ spring:
1313
format_sql: true
1414
highlight_sql: true
1515
generate_statistics: true
16-
show-sql: true
16+
show-sql: true
17+
18+
#swagger ??
19+
springdoc:
20+
swagger-ui:
21+
groups-order: DESC
22+
tags-sorter: alpha
23+
operations-sorter: method
24+
disable-swagger-default-url: true
25+
display-request-duration: true
26+
defaultModelsExpandDepth: 2
27+
defaultModelExpandDepth: 2
28+
api-docs:
29+
path: /api-docs
30+
show-actuator: true
31+
default-consumes-media-type: application/json
32+
default-produces-media-type: application/json
33+
writer-with-default-pretty-printer: true
34+
paths-to-match:
35+
- /api/**

0 commit comments

Comments
 (0)