File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
src/main/java/dmu/dasom/api/global/swagger Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ package dmu .dasom .api .global .swagger ;
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 jwtAuthScheme = new SecurityScheme ()
17+ .name ("Authorization" )
18+ .type (SecurityScheme .Type .HTTP )
19+ .scheme ("bearer" )
20+ .bearerFormat ("JWT" );
21+
22+ SecurityRequirement securityRequirement = new SecurityRequirement ().addList ("bearerAuth" );
23+
24+ return new OpenAPI ()
25+ .info (new Info ()
26+ .title ("DASOM web API" )
27+ .version ("v1.0.0" ))
28+ .components (new Components ()
29+ .addSecuritySchemes ("bearerAuth" , jwtAuthScheme ))
30+ .addSecurityItem (securityRequirement );
31+ }
32+
33+ }
You can’t perform that action at this time.
0 commit comments