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 2929
3030import static org .springdoc .core .Constants .MVC_SERVLET_PATH ;
3131import 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 ;
3432import static org .springframework .web .servlet .view .UrlBasedViewResolver .REDIRECT_URL_PREFIX ;
3533
3634/**
@@ -45,25 +43,13 @@ public class SwaggerUiHome {
4543 @ Value (MVC_SERVLET_PATH )
4644 private String mvcServletPath ;
4745
48-
49- @ GetMapping (value = {DEFAULT_PATH_SEPARATOR , "" })
46+ @ GetMapping
5047 @ Operation (hidden = true )
5148 public String index () {
5249 StringBuilder uiRootPath = new StringBuilder ();
53-
5450 if (StringUtils .isNotBlank (mvcServletPath ))
5551 uiRootPath .append (mvcServletPath );
5652
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 ;
6854 }
6955}
Original file line number Diff line number Diff line change 3636import org .springframework .web .util .UriComponentsBuilder ;
3737
3838import static org .springdoc .core .Constants .SWAGGER_UI_PATH ;
39- import static org .springframework .util .AntPathMatcher .DEFAULT_PATH_SEPARATOR ;
4039
4140/**
4241 * Home redirection to swagger api documentation
@@ -71,7 +70,7 @@ public SwaggerUiHome(Optional<WebFluxProperties> optionalWebFluxProperties) {
7170 * @param response the response
7271 * @return the mono
7372 */
74- @ GetMapping ( DEFAULT_PATH_SEPARATOR )
73+ @ GetMapping
7574 @ Operation (hidden = true )
7675 public Mono <Void > index (ServerHttpResponse response ) {
7776 UriComponentsBuilder uriBuilder = UriComponentsBuilder .fromUriString (this .basePath + swaggerUiPath );
You can’t perform that action at this time.
0 commit comments