Skip to content

Commit

Permalink
Merge pull request #14 from Team-Shaka/feat/13
Browse files Browse the repository at this point in the history
✨  Feat: 스웨거 세팅
  • Loading branch information
HyoBN authored Apr 25, 2024
2 parents 6f89ef6 + 162413c commit 1b8f13f
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
5 changes: 5 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ dependencies {
// mysql
runtimeOnly 'com.mysql:mysql-connector-j'

// swagger
implementation 'io.springfox:springfox-swagger2:2.9.2'
implementation 'io.springfox:springfox-swagger-ui:2.9.2'
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2'

testImplementation 'org.springframework.boot:spring-boot-starter-test'
}

Expand Down
22 changes: 22 additions & 0 deletions src/main/java/treehouse/server/global/config/SwaggerConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package treehouse.server.global.config;

import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.servers.Server;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class SwaggerConfig {
@Bean
public OpenAPI SpringCodeBaseAPI() {
Info info = new Info()
.title("PeerNa API")
.description("PeerNa API 명세서")
.version("1.0.0");

return new OpenAPI()
.addServersItem(new Server().url("/"))
.info(info);
}
}
4 changes: 2 additions & 2 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ spring:
format_sql: true
use_sql_comments: true
hbm2ddl:
auto: update
auto: create
default_batch_fetch_size: 1000
data:
redis:
Expand Down Expand Up @@ -117,7 +117,7 @@ spring:
format_sql: true
use_sql_comments: true
hbm2ddl:
auto: update
auto: create
default_batch_fetch_size: 1000
jwt:
header: Authorization
Expand Down

0 comments on commit 1b8f13f

Please sign in to comment.