-
Notifications
You must be signed in to change notification settings - Fork 200
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
swagger includeApplicationPath="true" results in no methods #1060
Comments
This is v2.13.2 |
In the swagger.json file, it looks like all of the paths are correct in that they are prefixed with the application path, but are empty. |
I did some debugging this weekend and I believe that I have found the issue. I have included a git diff (below) of a proposed fix that I believe matches your coding pattern. I tested it with both 'includeApplicationPath' set to true and false. I hope this helps.
BTW: The documentation for both the docs and swagger modules incorrectly call the configuration parameter 'includeApplicationRoot' instead of 'includeApplicationPath'. |
Thanks for the look. That patch seems to be based off an old version. Can you confirm you're looking at the latest? |
Hi Ryan,
No problem. Glad to help.
I based on a git pull from master. I just checked and it still says that I am up to date.
My pom indicates 2.14.0.SNAPSHOT as well. Is there another branch that I should be looking at?
Thanks,
Scott
[sortel@centos8-vm enunciate]$ git branch
* master
[sortel@centos8-vm enunciate]$ git pull
Already up to date.
[sortel@centos8-vm enunciate]$ git diff
diff --git a/swagger/src/main/java/com/webcohesion/enunciate/modules/swagger/SwaggerModule.java b/swagger/src/main/java/com/webcohesion/enunciate/modules/swagger/SwaggerModule.java
index 1626bfede..00494d7d1 100644
--- a/swagger/src/main/java/com/webcohesion/enunciate/modules/swagger/SwaggerModule.java
+++ b/swagger/src/main/java/com/webcohesion/enunciate/modules/swagger/SwaggerModule.java
@@ -200,7 +200,11 @@ public class SwaggerModule extends BasicGeneratingModule implements ApiFeaturePr
}
for (Resource resource : resourceGroup.getResources()) {
- if (path.equals(resource.getPath())) {
+ String resourcePath = resource.getPath();
+ if (includeApplicationPath && !StringUtils.isEmpty(resourcePath)) {
+ resourcePath = "/" + resourceGroup.getRelativeContextPath() + resourcePath;
+ }
+ if (path.equals(resourcePath)) {
swaggerResource.getMethods().addAll(resource.getMethods());
}
}
… On Oct 21, 2020, at 1:08 PM, Ryan Heaton ***@***.***> wrote:
Thanks for the look.
That patch seems to be based off an old version. Can you confirm you're looking at the latest?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#1060 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABQIJS5DYPZLWBJOTNOGRGLSL4ISRANCNFSM4SKASAGA>.
|
Applied at 9b62151. |
Hi Ryan, Do you have a projected release date for 2.14 yet? |
I'll try to get something cut within the next two weeks or so. |
|
Thank you!
… On Mar 9, 2021, at 6:32 PM, Ryan Heaton ***@***.***> wrote:
2.13.3 is now available.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#1060 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABQIJSZIXKDNP6KFD47MKULTC2OWDANCNFSM4SKASAGA>.
|
Related to #1004
Sorry it has taken me so long to give this a go but I'm sure you understand. Man, we are so close on this!
Adding includeApplicationPath="true" on the 'docs' module works well! However, when I added it to the swagger module, it results in no methods under the endpoint. I don't see any issues during the maven build.
I included my enunciate.xml and two screen snapshots, one with 'false' and the other with 'true'. I hope that helps. I can also provide you with a short Java example if that helps as well.
Thanks again for working this. It is so helpful!
enunciate.xml.txt
The text was updated successfully, but these errors were encountered: