-
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
Showing
5 changed files
with
62 additions
and
1 deletion.
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
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,35 @@ | ||
package com.umc.dream.config; | ||
|
||
import io.swagger.v3.oas.annotations.servers.Server; | ||
import io.swagger.v3.oas.models.Components; | ||
import io.swagger.v3.oas.models.OpenAPI; | ||
import io.swagger.v3.oas.models.security.SecurityRequirement; | ||
import io.swagger.v3.oas.models.security.SecurityScheme; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; | ||
|
||
import java.util.Arrays; | ||
|
||
@Configuration | ||
public class SwaggerConfig implements WebMvcConfigurer { | ||
|
||
private static final String BEARER_TOKEN_PREFIX = "Bearer"; | ||
|
||
@Bean | ||
public OpenAPI openAPI() { | ||
String jwtSchemeName = "JWT TOKEN"; | ||
SecurityRequirement securityRequirement = new SecurityRequirement().addList(jwtSchemeName); | ||
Components components = new Components() | ||
.addSecuritySchemes(jwtSchemeName, new SecurityScheme() | ||
.name(jwtSchemeName) | ||
.type(SecurityScheme.Type.HTTP) | ||
.scheme(BEARER_TOKEN_PREFIX) | ||
.bearerFormat("JWT")); | ||
|
||
// Swagger UI 접속 후, 딱 한 번만 accessToken을 입력해주면 모든 API에 토큰 인증 작업이 적용됩니다. | ||
return new OpenAPI() | ||
.addSecurityItem(securityRequirement) | ||
.components(components); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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,23 @@ | ||
spring: | ||
application: | ||
name: dream | ||
|
||
|
||
springdoc: | ||
swagger-ui: | ||
# swagger-ui ?? ??. default ?? /swagger-ui.html??. | ||
path: /swagger-custom-ui.html | ||
|
||
# openAPI ?? ??. default ?? /v3/api-docs ??. | ||
api-docs: | ||
path: /api-docs | ||
|
||
# request media type ? ?? ? | ||
default-consumes-media-type: application/json | ||
|
||
# response media type ? ?? ? | ||
default-produces-media-type: application/json | ||
|
||
# ?? ??? ???? controller? swagger-ui? ????. | ||
# paths-to-match: | ||
# - /api/** |