我用下面的Maven插件来招摇着我的应用程序 https://github.com/martypitt/swagger-springmvc为什么招摇的注释生成API的文档的默认路径前缀
整合我配置了下面我春天的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>
我招摇的财产看起来像下面
documentation.services.basePath = http://payrollservice.com/customservice documentation.services.version = 1.0
我的API-docs.json获取生成的样子如下,我不知道为什么它没有一个基本路径,为什么它有一个前缀“/默认”
{
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"
}
}