Skip to content
This repository has been archived by the owner on Nov 11, 2017. It is now read-only.

Doclet generates doubled / character for @Path("") #32

Open
zdila opened this issue Jul 3, 2013 · 2 comments
Open

Doclet generates doubled / character for @Path("") #32

zdila opened this issue Jul 3, 2013 · 2 comments

Comments

@zdila
Copy link
Contributor

zdila commented Jul 3, 2013

In our application we have resource annotated with @path(""). Swagger Doclet generates incorrect URLs containing //. Following patch will fix the issue:

diff --git a/jaxrs-doclet/src/main/java/com/hypnoticocelot/jaxrs/doclet/parser/AnnotationHelper.java b/jaxrs-doclet/src/main/java/com/hypnoticocelot/jaxrs/doclet/parser/AnnotationHelper.java
index 5ffb3e8..9f52a24 100644
--- a/jaxrs-doclet/src/main/java/com/hypnoticocelot/jaxrs/doclet/parser/AnnotationHelper.java
+++ b/jaxrs-doclet/src/main/java/com/hypnoticocelot/jaxrs/doclet/parser/AnnotationHelper.java
@@ -38,7 +38,7 @@ public class AnnotationHelper {
                         if (path.endsWith("/")) {
                             path = path.substring(0, path.length() - 1);
                         }
-                        return path.startsWith("/") ? path : "/" + path;
+                        return path.isEmpty() || path.startsWith("/") ? path : "/" + path;
                     }
                 }
             }
@ESPNMichaelKidd
Copy link
Contributor

Perhaps you could submit this change as a pull request? That would certainly cause it to be merged sooner...

@zdila
Copy link
Contributor Author

zdila commented Jul 3, 2013

ok

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants