File tree Expand file tree Collapse file tree 3 files changed +42
-9
lines changed
springdoc-openapi-common/src/main/java/org/springdoc/core
main/java/org/springdoc/webmvc/ui
test/java/test/org/springdoc/ui/app3 Expand file tree Collapse file tree 3 files changed +42
-9
lines changed Original file line number Diff line number Diff line change @@ -305,11 +305,6 @@ public final class Constants {
305305 */
306306 public static final String HEALTH_PATTERN = "/health/*" ;
307307
308- /**
309- * The constant SWAGGER_UI_PATTERN.
310- */
311- public static final String SWAGGER_UI_PATTERN = SWAGGER_UI_PREFIX + ALL_PATTERN ;
312-
313308 /**
314309 * The constant SPRINGDOC_USE_MANAGEMENT_PORT.
315310 */
Original file line number Diff line number Diff line change 2828import org .springframework .web .servlet .config .annotation .ResourceHandlerRegistry ;
2929import org .springframework .web .servlet .config .annotation .WebMvcConfigurerAdapter ;
3030
31- import static org .springdoc .core .Constants .ALL_PATTERN ;
3231import static org .springdoc .core .Constants .CLASSPATH_RESOURCE_LOCATION ;
3332import static org .springdoc .core .Constants .DEFAULT_WEB_JARS_PREFIX_URL ;
34- import static org .springdoc .core .Constants .SWAGGER_UI_PATTERN ;
33+ import static org .springdoc .core .Constants .SWAGGER_UI_PREFIX ;
3534import static org .springframework .util .AntPathMatcher .DEFAULT_PATH_SEPARATOR ;
3635
3736/**
@@ -79,8 +78,7 @@ public void addResourceHandlers(ResourceHandlerRegistry registry) {
7978 if (actuatorProvider .isPresent () && actuatorProvider .get ().isUseManagementPort ())
8079 uiRootPath .append (actuatorProvider .get ().getBasePath ());
8180
82- uiRootPath .append (ALL_PATTERN );
83- registry .addResourceHandler (uiRootPath + SWAGGER_UI_PATTERN )
81+ registry .addResourceHandler (uiRootPath +SWAGGER_UI_PREFIX +"*/**" )
8482 .addResourceLocations (CLASSPATH_RESOURCE_LOCATION + DEFAULT_WEB_JARS_PREFIX_URL + DEFAULT_PATH_SEPARATOR )
8583 .resourceChain (false )
8684 .addTransformer (swaggerIndexTransformer );
Original file line number Diff line number Diff line change 1+ /*
2+ *
3+ * *
4+ * * * Copyright 2019-2020 the original author or authors.
5+ * * *
6+ * * * Licensed under the Apache License, Version 2.0 (the "License");
7+ * * * you may not use this file except in compliance with the License.
8+ * * * You may obtain a copy of the License at
9+ * * *
10+ * * * https://www.apache.org/licenses/LICENSE-2.0
11+ * * *
12+ * * * Unless required by applicable law or agreed to in writing, software
13+ * * * distributed under the License is distributed on an "AS IS" BASIS,
14+ * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+ * * * See the License for the specific language governing permissions and
16+ * * * limitations under the License.
17+ * *
18+ *
19+ */
20+
21+ package test .org .springdoc .ui .app3 ;
22+
23+ /**
24+ * @author bnasslashen
25+ */
26+
27+ import org .springframework .context .annotation .Configuration ;
28+ import org .springframework .web .servlet .config .annotation .PathMatchConfigurer ;
29+ import org .springframework .web .servlet .config .annotation .WebMvcConfigurer ;
30+ import org .springframework .web .util .pattern .PathPatternParser ;
31+
32+ @ Configuration
33+ public class WebConfig implements WebMvcConfigurer {
34+
35+ @ Override
36+ public void configurePathMatch (PathMatchConfigurer configurer ) {
37+ configurer
38+ .setPatternParser (new PathPatternParser ());
39+ }
40+ }
You can’t perform that action at this time.
0 commit comments