Fix swagger config (#2437)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
@@ -19,17 +19,14 @@ import org.springframework.context.annotation.Bean;
|
|||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
@ConditionalOnProperty(
|
@ConditionalOnProperty(value = OpenApiConfiguration.HAWKBIT_SERVER_OPENAPI_ENABLED, havingValue = "true", matchIfMissing = true)
|
||||||
value = OpenApiConfiguration.HAWKBIT_SERVER_SWAGGER_ENABLED,
|
|
||||||
havingValue = "true",
|
|
||||||
matchIfMissing = true)
|
|
||||||
public class DdiOpenApiConfiguration {
|
public class DdiOpenApiConfiguration {
|
||||||
|
|
||||||
private static final String DDI_TOKEN_SEC_SCHEME_NAME = "Token";
|
private static final String DDI_TOKEN_SEC_SCHEME_NAME = "Token";
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
@ConditionalOnProperty(
|
@ConditionalOnProperty(
|
||||||
value = "hawkbit.server.swagger.ddi.api.group.enabled",
|
value = "hawkbit.server.openapi.ddi.enabled",
|
||||||
havingValue = "true",
|
havingValue = "true",
|
||||||
matchIfMissing = true)
|
matchIfMissing = true)
|
||||||
public GroupedOpenApi ddiApi() {
|
public GroupedOpenApi ddiApi() {
|
||||||
|
|||||||
@@ -19,10 +19,7 @@ import org.springframework.context.annotation.Bean;
|
|||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
@ConditionalOnProperty(
|
@ConditionalOnProperty(value = OpenApiConfiguration.HAWKBIT_SERVER_OPENAPI_ENABLED, havingValue = "true", matchIfMissing = true)
|
||||||
value = "hawkbit.server.swagger.enabled",
|
|
||||||
havingValue = "true",
|
|
||||||
matchIfMissing = true)
|
|
||||||
public class MgmtOpenApiConfiguration {
|
public class MgmtOpenApiConfiguration {
|
||||||
|
|
||||||
private static final String BASIC_AUTH_SEC_SCHEME_NAME = "Basic";
|
private static final String BASIC_AUTH_SEC_SCHEME_NAME = "Basic";
|
||||||
@@ -30,7 +27,7 @@ public class MgmtOpenApiConfiguration {
|
|||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
@ConditionalOnProperty(
|
@ConditionalOnProperty(
|
||||||
value = OpenApiConfiguration.HAWKBIT_SERVER_SWAGGER_ENABLED,
|
value = "hawkbit.server.openapi.mgmt.enabled",
|
||||||
havingValue = "true",
|
havingValue = "true",
|
||||||
matchIfMissing = true)
|
matchIfMissing = true)
|
||||||
public GroupedOpenApi mgmtApi() {
|
public GroupedOpenApi mgmtApi() {
|
||||||
|
|||||||
@@ -48,9 +48,6 @@ spring.rabbitmq.port=5672
|
|||||||
#hawkbit.server.security.cors.enabled=true
|
#hawkbit.server.security.cors.enabled=true
|
||||||
#hawkbit.server.security.cors.allowedOrigins=http://localhost
|
#hawkbit.server.security.cors.allowedOrigins=http://localhost
|
||||||
|
|
||||||
hawkbit.server.swagger.mgmt.api.group.enabled=true
|
|
||||||
hawkbit.server.swagger.ddi.api.group.enabled=false
|
|
||||||
|
|
||||||
# Swagger Configuration
|
# Swagger Configuration
|
||||||
springdoc.api-docs.version=openapi_3_0
|
springdoc.api-docs.version=openapi_3_0
|
||||||
springdoc.show-oauth2-endpoints=true
|
springdoc.show-oauth2-endpoints=true
|
||||||
|
|||||||
@@ -22,13 +22,10 @@ import org.springframework.context.annotation.Bean;
|
|||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
@ConditionalOnProperty(
|
@ConditionalOnProperty(value = OpenApiConfiguration.HAWKBIT_SERVER_OPENAPI_ENABLED, havingValue = "true", matchIfMissing = true)
|
||||||
value = OpenApiConfiguration.HAWKBIT_SERVER_SWAGGER_ENABLED,
|
|
||||||
havingValue = "true",
|
|
||||||
matchIfMissing = true)
|
|
||||||
public class OpenApiConfiguration {
|
public class OpenApiConfiguration {
|
||||||
|
|
||||||
public static final String HAWKBIT_SERVER_SWAGGER_ENABLED = "hawkbit.server.swagger.enabled";
|
public static final String HAWKBIT_SERVER_OPENAPI_ENABLED = "hawkbit.server.openapi.enabled";
|
||||||
|
|
||||||
public static final String X_HAWKBIT = "x-hawkbit";
|
public static final String X_HAWKBIT = "x-hawkbit";
|
||||||
public static final String ORDER = "order";
|
public static final String ORDER = "order";
|
||||||
|
|||||||
Reference in New Issue
Block a user