File tree Expand file tree Collapse file tree 2 files changed +3
-18
lines changed
springdoc-openapi-ui/src/main/java/org/springdoc/webmvc/ui
springdoc-openapi-webflux-ui/src/main/java/org/springdoc/webflux/ui Expand file tree Collapse file tree 2 files changed +3
-18
lines changed Original file line number Diff line number Diff line change 29
29
30
30
import static org .springdoc .core .Constants .MVC_SERVLET_PATH ;
31
31
import static org .springdoc .core .Constants .SWAGGER_UI_PATH ;
32
- import static org .springdoc .core .Constants .SWAGGER_UI_URL ;
33
- import static org .springframework .util .AntPathMatcher .DEFAULT_PATH_SEPARATOR ;
34
32
import static org .springframework .web .servlet .view .UrlBasedViewResolver .REDIRECT_URL_PREFIX ;
35
33
36
34
/**
@@ -45,25 +43,13 @@ public class SwaggerUiHome {
45
43
@ Value (MVC_SERVLET_PATH )
46
44
private String mvcServletPath ;
47
45
48
-
49
- @ GetMapping (value = {DEFAULT_PATH_SEPARATOR , "" })
46
+ @ GetMapping
50
47
@ Operation (hidden = true )
51
48
public String index () {
52
49
StringBuilder uiRootPath = new StringBuilder ();
53
-
54
50
if (StringUtils .isNotBlank (mvcServletPath ))
55
51
uiRootPath .append (mvcServletPath );
56
52
57
- if (swaggerUiPath .contains ("/" )) {
58
- uiRootPath .append (swaggerUiPath .substring (0 , swaggerUiPath .lastIndexOf ('/' )));
59
- }
60
-
61
- StringBuilder fullPath = new StringBuilder ();
62
-
63
- fullPath .append (REDIRECT_URL_PREFIX );
64
- fullPath .append (uiRootPath );
65
- fullPath .append (SWAGGER_UI_URL );
66
-
67
- return fullPath .toString ();
53
+ return REDIRECT_URL_PREFIX + uiRootPath + swaggerUiPath ;
68
54
}
69
55
}
Original file line number Diff line number Diff line change 36
36
import org .springframework .web .util .UriComponentsBuilder ;
37
37
38
38
import static org .springdoc .core .Constants .SWAGGER_UI_PATH ;
39
- import static org .springframework .util .AntPathMatcher .DEFAULT_PATH_SEPARATOR ;
40
39
41
40
/**
42
41
* Home redirection to swagger api documentation
@@ -71,7 +70,7 @@ public SwaggerUiHome(Optional<WebFluxProperties> optionalWebFluxProperties) {
71
70
* @param response the response
72
71
* @return the mono
73
72
*/
74
- @ GetMapping ( DEFAULT_PATH_SEPARATOR )
73
+ @ GetMapping
75
74
@ Operation (hidden = true )
76
75
public Mono <Void > index (ServerHttpResponse response ) {
77
76
UriComponentsBuilder uriBuilder = UriComponentsBuilder .fromUriString (this .basePath + swaggerUiPath );
You can’t perform that action at this time.
0 commit comments