Reputation: 11
I am trying to implementing Spring Web MVC with Swagger but problem is I could not getting model Schema. I am attaching code with question which is given blow. I'm following the below link:
http://raibledesigns.com/rd/entry/documenting_your_spring_api_with
the issue was that Swagger UI was displaying but for the post request it was not displaying the model schema.
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" />
Customer 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 {
}
}
Application properties:
documentation.services.version=1.0
documentation.services.basePath=http://localhost:9090/XYZ
Upvotes: 0
Views: 405
Reputation: 11
I just found the solution of the above issue.I just configure the swagger in my code internally.
i followed these link to configure the swagger. https://github.com/ufasoli/spring-mvc-swagger-tutorial.
These really works for me.
Upvotes: 1