swagger.api.basepath dynamic setup

1,937 views
Skip to first unread message

SwaggerIt

unread,
Jan 29, 2015, 10:34:29 AM1/29/15
to swagger-sw...@googlegroups.com
Is there a way to dynamically set swagger.api.basepath (which is configured in web.xml and controls root URL).
I found that I can do it programmatically(through ConfigReader) though it will still require me to have value in property file which needs to be maintained with different value on each server.

I understand for for external URL, i should need to configure it to hardcoded value.

but while deploying on different test and dev boxes, I don't want to be changing the web xml or properties file.
Is there a way that this can work even with plain ip address on URL?

I found similar question that was closed on springmvc (but didn't see what was the resolution)


Though I am not on spring and I am looking solution for tomcat, Jersey, Swagger stack.

Appreciate any help!!

SwaggerIt

unread,
Jan 29, 2015, 3:16:36 PM1/29/15
to swagger-sw...@googlegroups.com
Never mind. I did not need to put the full URL anyway. only putting the relative path works.

problem to me was I was putting base path as


and was required to change value of abc:223 whenever deploying on different box.

all I needed was to put "/api" and not whole URL.. should have thought it :)
Reply all
Reply to author
Forward
0 new messages