You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
1.1 KiB
30 lines
1.1 KiB
|
11 months ago
|
package kr.re.etri.autoflow.swagger;
|
||
|
11 months ago
|
|
||
|
|
import io.swagger.v3.oas.models.OpenAPI;
|
||
|
|
import io.swagger.v3.oas.models.info.Info;
|
||
|
|
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;
|
||
|
|
|
||
|
|
@Configuration
|
||
|
|
public class OpenAPIConfig {
|
||
|
|
|
||
|
|
private static final String SECURITY_SCHEME_NAME = "bezkoder-jwt-cookie";
|
||
|
|
|
||
|
|
@Bean
|
||
|
|
public OpenAPI customOpenAPI() {
|
||
|
|
return new OpenAPI()
|
||
|
|
.info(new Info()
|
||
|
|
.title("My API")
|
||
|
|
.version("v1"))
|
||
|
|
.addSecurityItem(new SecurityRequirement().addList(SECURITY_SCHEME_NAME))
|
||
|
|
.components(new io.swagger.v3.oas.models.Components()
|
||
|
|
.addSecuritySchemes(SECURITY_SCHEME_NAME,
|
||
|
|
new SecurityScheme()
|
||
|
|
.name("bezkoder-jwt")
|
||
|
|
.type(SecurityScheme.Type.APIKEY)
|
||
|
|
.in(SecurityScheme.In.COOKIE)));
|
||
|
|
}
|
||
|
|
}
|