0

Я пытаюсь внедрить Spring Web MVC с Swagger, но проблема в том, что я не мог получить модельную схему. У меня есть код с вопросом, которому дан удар. Я по следующей ссылке:Swagger implemetation Spring Web MVC не отображает модель Schema

http://raibledesigns.com/rd/entry/documenting_your_spring_api_with

проблема в том, что Форс 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" /> 

Заказчик Controller.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 

ответ

1

Я только что нашел решение вышеупомянутой проблемы. Я просто настраиваю swagger в своем коде внутри.

Я следил за этой ссылкой, чтобы настроить чванство. https://github.com/ufasoli/spring-mvc-swagger-tutorial.

Это действительно работает для меня.

Смежные вопросы