diff --git a/module-server/src/main/java/de/twomartens/wahlrecht/configuration/OpenApiConfiguration.java b/module-server/src/main/java/de/twomartens/wahlrecht/configuration/OpenApiConfiguration.java index 8fad819..b1077e4 100644 --- a/module-server/src/main/java/de/twomartens/wahlrecht/configuration/OpenApiConfiguration.java +++ b/module-server/src/main/java/de/twomartens/wahlrecht/configuration/OpenApiConfiguration.java @@ -1,18 +1,18 @@ package de.twomartens.wahlrecht.configuration; -import org.springdoc.core.models.GroupedOpenApi; -import org.springframework.context.annotation.Bean; +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.enums.SecuritySchemeType; +import io.swagger.v3.oas.annotations.info.Info; +import io.swagger.v3.oas.annotations.security.SecurityScheme; import org.springframework.context.annotation.Configuration; +@OpenAPIDefinition(info = @Info(title = "Wahlrecht API", version = "v1")) +@SecurityScheme( + name = "basicAuth", + type = SecuritySchemeType.HTTP, + scheme = "basic" +) @Configuration public class OpenApiConfiguration { - @Bean - public GroupedOpenApi swaggerApi10() { - return GroupedOpenApi.builder() - .group("1.0") - .pathsToMatch("/wahlrecht/v1/**") - .build(); - } - } diff --git a/module-server/src/main/resources/application.yaml b/module-server/src/main/resources/application.yaml index 4211d10..9a6fa4f 100644 --- a/module-server/src/main/resources/application.yaml +++ b/module-server/src/main/resources/application.yaml @@ -30,21 +30,21 @@ spring: default: dev # properties for application -de.twomartens.template: +de.twomartens.wahlrecht: defaultTimeZone: Europe/Berlin greeting: "Hello %s" springdoc: swagger-ui: - path: '/template/doc/' + path: '/wahlrecht/v1/doc/' api-docs: - path: '/template/api-docs/' + path: '/wahlrecht/v1/api-docs/' default-produces-media-type: 'application/json' openapi: #TODO write description/ changelog description: | - Open API Documentation for the Template + Open API Documentation for the Wahlrecht ## Header 2 @@ -57,7 +57,7 @@ openapi: | 1.0 | added API Versioning (and changelog) | Jim | 28.05.2023 | version: 1.0 - title: 'Template API' + title: 'Wahlrecht API' resttemplate: timeout: