【发布时间】:2016-09-30 19:44:15
【问题描述】:
我正在尝试使用 Swagger 实现 Spring Web MVC,但问题是我无法获取模型架构。 我附上了带有问题的代码,这个问题受到了打击。 我正在关注以下链接:
http://raibledesigns.com/rd/entry/documenting_your_spring_api_with
问题是 Swagger UI 正在显示,但对于发布请求,它没有显示模型架构。
POM.XML:
<dependency>
<groupId>com.mangofactory</groupId>
<artifactId>swagger-springmvc</artifactId>
<version>0.5.2</version>
</dependency>
Spring.xml:
<mvc:annotation-driven />
<context:component-scan base-package="com.ga" />
<mvc:default-servlet-handler />
<bean id="documentationConfig" class="com.mangofactory.swagger.configuration.DocumentationConfig" />
<context:property-placeholder location="classpath:spring/application.properties"
system-properties-mode="OVERRIDE" />
客户控制器.java:
@Api(value="CustomerController",description="Customer Controller")
@RestController
public class CustomerController {
@ApiOperation(value="save",notes="These Method is used to Save all Customer Details with its Deployment ")
@RequestMapping(value = "/save", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<Customer> saveCustomerDetails(@RequestBody Customer customer) throws CustomerException {
}
}
应用程序属性:
documentation.services.version=1.0
documentation.services.basePath=http://localhost:9090/XYZ
【问题讨论】:
标签: spring spring-mvc swagger swagger-ui swagger-maven-plugin