21
21
* * * *
22
22
* * *
23
23
* *
24
- *
24
+ *
25
25
*/
26
26
27
27
package org .springdoc .webflux .ui ;
28
28
29
29
import java .util .Optional ;
30
30
31
- import org .springdoc .core .properties .SpringDocConfigProperties ;
32
31
import org .springdoc .core .properties .SwaggerUiConfigProperties ;
33
32
import org .springdoc .core .providers .ActuatorProvider ;
34
33
38
37
import static org .springdoc .core .utils .Constants .ALL_PATTERN ;
39
38
import static org .springdoc .core .utils .Constants .CLASSPATH_RESOURCE_LOCATION ;
40
39
import static org .springdoc .core .utils .Constants .DEFAULT_WEB_JARS_PREFIX_URL ;
40
+ import static org .springdoc .core .utils .Constants .SWAGGER_UI_PREFIX ;
41
41
import static org .springframework .util .AntPathMatcher .DEFAULT_PATH_SEPARATOR ;
42
42
43
43
/**
@@ -67,30 +67,22 @@ public class SwaggerWebFluxConfigurer implements WebFluxConfigurer {
67
67
*/
68
68
private final SwaggerUiConfigProperties swaggerUiConfigProperties ;
69
69
70
- /**
71
- * The Spring doc config properties.
72
- */
73
- private final SpringDocConfigProperties springDocConfigProperties ;
74
-
75
- /**
70
+ /**
76
71
* Instantiates a new Swagger web flux configurer.
77
72
*
78
73
* @param swaggerUiConfigProperties the swagger ui calculated config
79
- * @param springDocConfigProperties the spring doc config properties
80
74
* @param swaggerIndexTransformer the swagger index transformer
81
75
* @param actuatorProvider the actuator provider
82
76
* @param swaggerResourceResolver the swagger resource resolver
83
77
*/
84
78
public SwaggerWebFluxConfigurer (SwaggerUiConfigProperties swaggerUiConfigProperties ,
85
- SpringDocConfigProperties springDocConfigProperties ,
86
- SwaggerIndexTransformer swaggerIndexTransformer ,
79
+ SwaggerIndexTransformer swaggerIndexTransformer ,
87
80
Optional <ActuatorProvider > actuatorProvider , SwaggerResourceResolver swaggerResourceResolver ) {
88
81
this .swaggerIndexTransformer = swaggerIndexTransformer ;
89
82
this .actuatorProvider = actuatorProvider ;
90
83
this .swaggerResourceResolver = swaggerResourceResolver ;
91
84
this .swaggerUiConfigProperties = swaggerUiConfigProperties ;
92
- this .springDocConfigProperties = springDocConfigProperties ;
93
- }
85
+ }
94
86
95
87
@ Override
96
88
public void addResourceHandlers (ResourceHandlerRegistry registry ) {
@@ -100,7 +92,7 @@ public void addResourceHandlers(ResourceHandlerRegistry registry) {
100
92
uiRootPath .append (swaggerPath , 0 , swaggerPath .lastIndexOf (DEFAULT_PATH_SEPARATOR ));
101
93
if (actuatorProvider .isPresent () && actuatorProvider .get ().isUseManagementPort ())
102
94
uiRootPath .append (actuatorProvider .get ().getBasePath ());
103
- registry .addResourceHandler (uiRootPath + springDocConfigProperties . getWebjars (). getPrefix () + ALL_PATTERN )
95
+ registry .addResourceHandler (uiRootPath + SWAGGER_UI_PREFIX + ALL_PATTERN )
104
96
.addResourceLocations (CLASSPATH_RESOURCE_LOCATION + DEFAULT_WEB_JARS_PREFIX_URL + DEFAULT_PATH_SEPARATOR )
105
97
.resourceChain (false )
106
98
.addResolver (swaggerResourceResolver )
0 commit comments