From 6d4a3e888cab8dd5a96a1ab58267122b3693eeaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eyl=C3=BCl=20=C3=96zatman?= Date: Fri, 24 Nov 2023 01:27:42 +0300 Subject: [PATCH] new-commit --- .../config/SwaggerConfig.java | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/main/java/airline/airlinemidterm4458/config/SwaggerConfig.java b/src/main/java/airline/airlinemidterm4458/config/SwaggerConfig.java index bfd3bc8..07475d5 100644 --- a/src/main/java/airline/airlinemidterm4458/config/SwaggerConfig.java +++ b/src/main/java/airline/airlinemidterm4458/config/SwaggerConfig.java @@ -1,9 +1,16 @@ package airline.airlinemidterm4458.config; +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.security.SecurityScheme; +import io.swagger.v3.oas.models.servers.Server; import org.springdoc.core.models.GroupedOpenApi; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import java.util.Collections; + @Configuration public class SwaggerConfig { @@ -18,4 +25,22 @@ public GroupedOpenApi customApi() { .build(); } + @Bean + public OpenAPI openApiConfiguration() { + return new OpenAPI() + .components(new Components() + .addSecuritySchemes("bearer-key", new SecurityScheme() + .type(SecurityScheme.Type.HTTP) + .scheme("bearer") + .bearerFormat("JWT") + ) + ) + .info(new Info() + .title("AIRLÄ°NE PROJECT") + .version("1.0.0") + .description("Project Api") + ); + + } + }