--
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.
String contextPathUrl = new URL(request.getScheme(), request.getServerName(), request.getServerPort(), filterConfig.getServletContext().getContextPath()).toExternalForm();
ConfigFactory.config().setBasePath(contextPathUrl);
Make sure this is done only once (remember state in a private static boolean) and apply filter mapping in your web.xml
<filter>
<filter-name>apidoc-config</filter-name>
<filter-class>my.ApiDocConfigFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>apidoc-config</filter-name>
<url-pattern>/api-docs/*</url-pattern>
</filter-mapping>