File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed
src/main/java/com/somemore/global/configure Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change 1+ package com .somemore .global .configure ;
2+
3+ import io .swagger .v3 .oas .models .Components ;
4+ import io .swagger .v3 .oas .models .OpenAPI ;
5+ import io .swagger .v3 .oas .models .info .Info ;
6+ import io .swagger .v3 .oas .models .security .SecurityRequirement ;
7+ import io .swagger .v3 .oas .models .security .SecurityScheme ;
8+ import org .springframework .context .annotation .Bean ;
9+ import org .springframework .context .annotation .Configuration ;
10+
11+ @ Configuration
12+ public class SwaggerConfig {
13+
14+ @ Bean
15+ public OpenAPI customOpenAPI () {
16+ SecurityScheme securityScheme = new SecurityScheme ()
17+ .type (SecurityScheme .Type .HTTP )
18+ .scheme ("bearer" )
19+ .bearerFormat ("JWT" )
20+ .description ("JWT 토큰을 이용한 인증" );
21+
22+ SecurityRequirement securityRequirement = new SecurityRequirement ()
23+ .addList ("AccessToken" );
24+
25+ return new OpenAPI ()
26+ .info (new Info ()
27+ .title ("Somemore API" )
28+ .version ("1.0" )
29+ .description ("Somemore swagger-ui 화면입니다." )
30+ )
31+ .components (new Components ()
32+ .addSecuritySchemes ("AccessToken" , securityScheme )
33+ )
34+ .addSecurityItem (securityRequirement );
35+ }
36+ }
You can’t perform that action at this time.
0 commit comments