It is possible, and I implement it as follows:
In swaggerui, I programmatically declare my url by selecting the url via javascript:
// Get the url: theUrl = window.location.protocol+"//" + window.location.host+"/docs"; window.swaggerUi = new SwaggerUi({ url: theUrl,..other parameters...})
In my json files where I declare the resource, I simply declare my base path as "/", as shown below:
{ "apiVersion": "1.0.0", "swaggerVersion": "1.2", "basePath": "/", "resourcePath": "/api/myapi".......
Hope this helps!
source share