In swagger 1.2.9-1.2.3 or old versions we have config reader com.wordnik.swagger.jaxrs.ConfigReader
class, we can extend this class and we can declare swagger
There's a thread explaining how to do this on the Swagger google group.
Basically, in Swagger 1.3, you need to use the SwaggerConfig class, like so:
SwaggerConfig config = new SwaggerConfig();
config.setBasePath(yourBasePathVariable);
ConfigFactory.setConfig(config);
However, you need this to occur after Swagger loads and sets the default basePath, because otherwise (if your basePath gets set first) it will be overwritten.