Skip to content

Commit

Permalink
Merge pull request #9 from Likelion-Inner-Join/swagger
Browse files Browse the repository at this point in the history
[Feat] swagger 추가
  • Loading branch information
gorapang authored Dec 1, 2024
2 parents 833bfd4 + 6f2a823 commit 3aa90a4
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
3 changes: 3 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ dependencies {
runtimeOnly 'com.mysql:mysql-connector-j'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'

//swagger
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2'
}

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

import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.info.Info;
import lombok.RequiredArgsConstructor;
import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@OpenAPIDefinition(
info = @Info(title = "Zerock App", version = "v1"))
@RequiredArgsConstructor
@Configuration
public class SwaggerConfig {

@Bean
public GroupedOpenApi chatOpenApi(){
String[] paths = {"/**"};

return GroupedOpenApi.builder()
.group("Zerock OPEN API v1")
.pathsToMatch(paths)
.build();
}

}
7 changes: 7 additions & 0 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,10 @@ server:
servlet:
session:
timeout: 30m

springdoc:
api-docs:
enabled: true
swagger-ui:
enabled: true

0 comments on commit 3aa90a4

Please sign in to comment.