ApiListing - swagger 1.2.3

33 views
Skip to first unread message

antonio.m...@gmail.com

unread,
Mar 24, 2015, 9:56:28 AM3/24/15
to swagger-sw...@googlegroups.com
Hi all,
I am using Resteasy to provide REST services and swagger version 1.2.3 to document these API.

In my application.ear, I have a web application with a resteasy servlet providing some rest resources. Api docs are generated automatically through a Resource extending com.wordnik.swagger.jaxrs.listing.ApiListing exposed at /api-docs. 

Now I want to create a new web application in the same application.ear to provide some other rest resources:
  - The base path path of first web app is http://localhost:8080/app1/rest 
  - while the base path of the second web app is http://localhost:8080/app2/rest. 
I have created a new extension of ApiListing to document the rest resources of the second webapp.

So I expect that 
  - accessing http://localhost:8080/app1/rest/api-docs I have to see documentation of first webapp resources
  - while accessing http://localhost:8080/app2/rest/api-docs I have to see documentation of second webapp resources.

Instead of that, whatever url I visit, I see the same documentation, specifically the first documention accessed after application deploy
  - so If I deploy the application and then go to http://localhost:8080/app1/rest/api-docs, then both url will show api docs of first web app resources
  - while If I deploy the application and then go to http://localhost:8080/app2/rest/api-docs, then both url will show api docs of second web app resources

So the question is: I'm doing something wrong or it's impossible to have multiple swagger apilisting in the same application?

Consider that it's hard for me upgrade the used swagger version :-(

Thanks a lot for your help
Antonio

Ron Ratovsky

unread,
Mar 26, 2015, 12:47:36 PM3/26/15
to swagger-sw...@googlegroups.com
Do you mean that you use swagger-core 1.2.3?

--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
-----------------------------------------
http://swagger.io
https://twitter.com/SwaggerApi
-----------------------------------------

antonio.m...@gmail.com

unread,
Apr 14, 2015, 10:30:30 AM4/14/15
to swagger-sw...@googlegroups.com
Yes I'm using swagger-core 1.2.3

I've resolved including swagger-core.jar in both .wars lib directory.

Il giorno giovedì 26 marzo 2015 17:47:36 UTC+1, Ron ha scritto:
Do you mean that you use swagger-core 1.2.3?
On Tue, Mar 24, 2015 at 3:56 PM, <antonio.m...@gmail.com> wrote:
Hi all,
I am using Resteasy to provide REST services and swagger version 1.2.3 to document these API.

In my application.ear, I have a web application with a resteasy servlet providing some rest resources. Api docs are generated automatically through a Resource extending com.wordnik.swagger.jaxrs.listing.ApiListing exposed at /api-docs. 

Now I want to create a new web application in the same application.ear to provide some other rest resources:
  - The base path path of first web app is http://localhost:8080/app1/rest 
  - while the base path of the second web app is http://localhost:8080/app2/rest. 
I have created a new extension of ApiListing to document the rest resources of the second webapp.

So I expect that 
  - accessing http://localhost:8080/app1/rest/api-docs I have to see documentation of first webapp resources
  - while accessing http://localhost:8080/app2/rest/api-docs I have to see documentation of second webapp resources.

Instead of that, whatever url I visit, I see the same documentation, specifically the first documention accessed after application deploy
  - so If I deploy the application and then go to http://localhost:8080/app1/rest/api-docs, then both url will show api docs of first web app resources
  - while If I deploy the application and then go to http://localhost:8080/app2/rest/api-docs, then both url will show api docs of second web app resources

So the question is: I'm doing something wrong or it's impossible to have multiple swagger apilisting in the same application?

Consider that it's hard for me upgrade the used swagger version :-(

Thanks a lot for your help
Antonio

--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Ron Ratovsky

unread,
Apr 14, 2015, 10:45:09 AM4/14/15
to swagger-sw...@googlegroups.com
Okay, you pretty much can't do that. The older versions of swagger-core do not support the exposing multiple APIs within a single WAR. You'd either have to update to the latest, or separate the APIs to different WARs.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages