Fixed OpenAPI configuration
This commit is contained in:
+10
-10
@@ -1,18 +1,18 @@
|
|||||||
package de.twomartens.wahlrecht.configuration;
|
package de.twomartens.wahlrecht.configuration;
|
||||||
|
|
||||||
import org.springdoc.core.models.GroupedOpenApi;
|
import io.swagger.v3.oas.annotations.OpenAPIDefinition;
|
||||||
import org.springframework.context.annotation.Bean;
|
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;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
@OpenAPIDefinition(info = @Info(title = "Wahlrecht API", version = "v1"))
|
||||||
|
@SecurityScheme(
|
||||||
|
name = "basicAuth",
|
||||||
|
type = SecuritySchemeType.HTTP,
|
||||||
|
scheme = "basic"
|
||||||
|
)
|
||||||
@Configuration
|
@Configuration
|
||||||
public class OpenApiConfiguration {
|
public class OpenApiConfiguration {
|
||||||
|
|
||||||
@Bean
|
|
||||||
public GroupedOpenApi swaggerApi10() {
|
|
||||||
return GroupedOpenApi.builder()
|
|
||||||
.group("1.0")
|
|
||||||
.pathsToMatch("/wahlrecht/v1/**")
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,21 +30,21 @@ spring:
|
|||||||
default: dev
|
default: dev
|
||||||
|
|
||||||
# properties for application
|
# properties for application
|
||||||
de.twomartens.template:
|
de.twomartens.wahlrecht:
|
||||||
defaultTimeZone: Europe/Berlin
|
defaultTimeZone: Europe/Berlin
|
||||||
greeting: "Hello %s"
|
greeting: "Hello %s"
|
||||||
|
|
||||||
springdoc:
|
springdoc:
|
||||||
swagger-ui:
|
swagger-ui:
|
||||||
path: '/template/doc/'
|
path: '/wahlrecht/v1/doc/'
|
||||||
api-docs:
|
api-docs:
|
||||||
path: '/template/api-docs/'
|
path: '/wahlrecht/v1/api-docs/'
|
||||||
default-produces-media-type: 'application/json'
|
default-produces-media-type: 'application/json'
|
||||||
|
|
||||||
openapi:
|
openapi:
|
||||||
#TODO write description/ changelog
|
#TODO write description/ changelog
|
||||||
description: |
|
description: |
|
||||||
Open API Documentation for the Template
|
Open API Documentation for the Wahlrecht
|
||||||
|
|
||||||
## Header 2
|
## Header 2
|
||||||
|
|
||||||
@@ -57,7 +57,7 @@ openapi:
|
|||||||
| 1.0 | added API Versioning (and changelog) | Jim | 28.05.2023 |
|
| 1.0 | added API Versioning (and changelog) | Jim | 28.05.2023 |
|
||||||
|
|
||||||
version: 1.0
|
version: 1.0
|
||||||
title: 'Template API'
|
title: 'Wahlrecht API'
|
||||||
|
|
||||||
resttemplate:
|
resttemplate:
|
||||||
timeout:
|
timeout:
|
||||||
|
|||||||
Reference in New Issue
Block a user