|
21 | 21 | package org.springdoc.webflux.ui; |
22 | 22 |
|
23 | 23 | import java.util.Map; |
| 24 | +import java.util.Optional; |
24 | 25 |
|
25 | 26 | import io.swagger.v3.oas.annotations.Operation; |
| 27 | +import org.apache.commons.lang3.StringUtils; |
26 | 28 | import org.springdoc.core.SpringDocConfigProperties; |
27 | 29 | import org.springdoc.core.SwaggerUiConfigParameters; |
28 | 30 | import org.springdoc.core.SwaggerUiConfigProperties; |
@@ -50,19 +52,19 @@ public class SwaggerWelcomeWebFlux extends SwaggerWelcomeCommon { |
50 | 52 | /** |
51 | 53 | * The Webflux base path. |
52 | 54 | */ |
53 | | - private String webfluxBasePath; |
| 55 | + private String webfluxBasePath = StringUtils.EMPTY ; |
54 | 56 |
|
55 | 57 | /** |
56 | 58 | * Instantiates a new Swagger welcome. |
57 | 59 | * |
58 | 60 | * @param swaggerUiConfig the swagger ui config |
59 | 61 | * @param springDocConfigProperties the spring doc config properties |
60 | 62 | * @param swaggerUiConfigParameters the swagger ui config parameters |
61 | | - * @param webFluxProperties the web flux properties |
| 63 | + * @param webFluxPropertiesOptional the web flux properties |
62 | 64 | */ |
63 | | - public SwaggerWelcomeWebFlux(SwaggerUiConfigProperties swaggerUiConfig, SpringDocConfigProperties springDocConfigProperties, SwaggerUiConfigParameters swaggerUiConfigParameters, WebFluxProperties webFluxProperties) { |
| 65 | + public SwaggerWelcomeWebFlux(SwaggerUiConfigProperties swaggerUiConfig, SpringDocConfigProperties springDocConfigProperties, SwaggerUiConfigParameters swaggerUiConfigParameters, Optional<WebFluxProperties> webFluxPropertiesOptional) { |
64 | 66 | super(swaggerUiConfig, springDocConfigProperties, swaggerUiConfigParameters); |
65 | | - webfluxBasePath = webFluxProperties.getBasePath(); |
| 67 | + webFluxPropertiesOptional.ifPresent(webFluxProperties -> webfluxBasePath = webFluxProperties.getBasePath()); |
66 | 68 | } |
67 | 69 |
|
68 | 70 | /** |
|
0 commit comments