【问题标题】:Swagger implemetation Spring Web MVC not display model SchemaSwagger 实现 Spring Web MVC 不显示模型 Schema
【发布时间】: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


    【解决方案1】:

    我刚刚找到了上述问题的解决方案。我只是在内部代码中配置了swagger。

    我按照这些链接来配置招摇。 https://github.com/ufasoli/spring-mvc-swagger-tutorial.

    这些真的很适合我。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-08-31
      • 2013-06-01
      • 2023-03-08
      • 2023-03-17
      • 1970-01-01
      • 1970-01-01
      • 2017-10-08
      • 1970-01-01
      相关资源
      最近更新 更多