Skip to content

Commit

Permalink
Merge pull request #12 from prgrms-be-devcourse/feature/swagger-setting
Browse files Browse the repository at this point in the history
[FEAT] Swagger 세팅
  • Loading branch information
kimdw0823 authored Sep 24, 2024
2 parents 327f8e4 + 86e9d45 commit 20fa0f8
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ dependencies {
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2' //Swagger 의존성 추가
}

tasks.named('test') {
Expand Down
29 changes: 29 additions & 0 deletions src/main/java/com/example/book_your_seat/config/SwaggerConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package com.example.book_your_seat.config;

import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class SwaggerConfig {
@Bean
public OpenAPI openAPI() {
return new OpenAPI()
.info(new Info()
.title("book-your-seat API")
.description("book-your-seat의 API 문서입니다.")
.version("1.0.0"));
}

//UserController 설정
@Bean
public GroupedOpenApi bookYourSeatApi() {
return GroupedOpenApi.builder()
.group("user API")
.pathsToMatch("/api/v1/users/**")
.build();
}

}

0 comments on commit 20fa0f8

Please sign in to comment.