I used the below maven plugin to integrate swagger with my application https://github.com/martypitt/swagger-springmvc
I configured the below in my spring servlet xml
<mvc:annotation-driven/> <!-- Required so swagger-springmvc can access spring's RequestMappingHandlerMapping -->
<bean class="com.mangofactory.swagger.configuration.SpringSwaggerConfig" />
<mvc:default-servlet-handler/>
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations" >
<list>
<value>/WEB-INF/swagger.properties</value>
</list>
</property>
</bean>
My swagger properties looked like below
documentation.services.basePath=http://payrollservice.com/customservice documentation.services.version=1.0
My api-docs.json that gets generated looks like as below and I am not sure why it does not have a base path and why it has a prefix "/default"
{
apiVersion: "1.0",
swaggerVersion: "1.2",
apis: [
{
path: "/default/custom-controller",
description: "backupset API"
}
],
info: {
title: "default Title",
description: "Api Description",
termsOfServiceUrl: "Api terms of service",
contact: "Contact Email",
license: "Licence Type",
licenseUrl: "License URL"
}
}