🚑 Fix swagger url

This commit is contained in:
SebClem 2022-06-17 18:19:58 +02:00
parent 0364dabb89
commit 3fa9f8f7a1
Signed by: sebclem
GPG Key ID: 5A4308F6A359EA50

View File

@ -1,21 +1,22 @@
package net.Broken.Api.OpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
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 io.swagger.v3.oas.models.servers.Server;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class OpenApiConfig {
@Bean
public OpenAPI customOpenAPI() {
final String securitySchemeName = "JWT";
// final String apiTitle = String.format("%s API", StringUtils.capitalize(moduleName));
return new OpenAPI()
.addSecurityItem(new SecurityRequirement().addList(securitySchemeName))
@ -28,6 +29,7 @@ public class OpenApiConfig {
.scheme("bearer")
.bearerFormat("JWT")
)
);
)
.addServersItem(new Server().url("/").description("Default"));
}
}