This is an automated email from the ASF dual-hosted git repository.
deki pushed a commit to branch 3.1.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git
The following commit(s) were added to refs/heads/3.1.x-fixes by this push:
new b458639 [CXF-7734] merged current SwaggerUiService from 3.2.x to
Swagger2Feature.SwaggerUIService closes #416
b458639 is described below
commit b458639acaff21a4fd8d96c92171367cb2a06a29
Author: Dennis Kieselhorst <[email protected]>
AuthorDate: Thu May 3 19:59:42 2018 +0200
[CXF-7734] merged current SwaggerUiService from 3.2.x to
Swagger2Feature.SwaggerUIService closes #416
---
.../java/org/apache/cxf/jaxrs/swagger/Swagger2Feature.java | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git
a/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/Swagger2Feature.java
b/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/Swagger2Feature.java
index 7ea8d4c..38632bc 100644
---
a/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/Swagger2Feature.java
+++
b/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/Swagger2Feature.java
@@ -619,12 +619,13 @@ public class Swagger2Feature extends
AbstractSwaggerFeature {
}
try {
- URL resourceURL = locator.locate(resourcePath);
-
+ final URL resourceURL = locator.locate(resourcePath);
+ final String path = resourceURL.getPath();
+
String mediaType = null;
- int ind = resourcePath.lastIndexOf('.');
- if (ind != -1 && ind < resourcePath.length()) {
- String resourceExt = resourcePath.substring(ind + 1);
+ int ind = path.lastIndexOf('.');
+ if (ind != -1 && ind < path.length()) {
+ String resourceExt = path.substring(ind + 1);
if (mediaTypes != null &&
mediaTypes.containsKey(resourceExt)) {
mediaType = mediaTypes.get(resourceExt);
} else {
--
To stop receiving notification emails like this one, please contact
[email protected].