-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3d0e393
commit e1d4c49
Showing
5 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
src/main/java/com/wanted/teamr/tastyfinder/api/config/SpringDocConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package com.wanted.teamr.tastyfinder.api.config; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import org.springdoc.core.properties.SpringDocConfigProperties; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
@Configuration | ||
@RequiredArgsConstructor | ||
public class SpringDocConfig { | ||
|
||
private final SpringDocConfigProperties springDocConfigProperties; | ||
|
||
/** | ||
* swagger ui 웹 페이지 주소: /swagger-ui/index.html | ||
* <p> | ||
* swagger ui 웹 페이지 리소스(js, css 등) 주소: /swagger-ui/** | ||
* | ||
* @return swagger-ui 웹 페이지, 웹 페이지를 위한 리소스 모두를 포함하는 주소 반환 | ||
*/ | ||
@Bean(name = "swaggerPath") | ||
public String getSwaggerPath() { | ||
return "/swagger-ui/**"; | ||
} | ||
|
||
/** | ||
* api doc 주소: configuraiton file의 {springdoc.api-docs.path} | ||
* <p> | ||
* swagger-ui에서 요청하는 리소스(swagger-config 등) 주소: {springdoc.api-docs.path}/** | ||
* | ||
* @return api doc 주소와 그 외 swagger-ui에서 요청하는 리소스 모두를 포함하는 주소 반환 | ||
*/ | ||
@Bean(name = "apiDocPath") | ||
public String getApiDocPath() { | ||
return springDocConfigProperties.getApiDocs().getPath() + "/**"; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
springdoc: | ||
api-docs: | ||
path: /api-docs |