I have created a rest controller as per the documentation, I updated the rest-dispatcher-spring.xml to include the Resource package as well as the rest-services.xml.
I am able to call the API successfully, but when I check swagger for API my customer controller is not showing.
What am I doing wrong?
@RestController
@RequestMapping("/test-api")
public class TestAPI {
@RequestMapping(value = "/post", method = RequestMethod.POST, produces = APPLICATION_JSON_VALUE)
public ResponseEntity createRequestForm(Test test) {
return new ResponseEntity<>(HttpStatus.OK);
}
@RequestMapping(value = "/get", method = RequestMethod.GET, produces = APPLICATION_JSON_VALUE)
public ResponseEntity getRequestForms() {
return new ResponseEntity<>(HttpStatus.OK);
}
@RequestMapping(value = "/put", method = RequestMethod.PUT, produces = APPLICATION_JSON_VALUE)
public ResponseEntity updateRequestForm(Test test) {
return new ResponseEntity<>(HttpStatus.OK);
}
@RequestMapping(value = "/delete", method = RequestMethod.DELETE, produces = APPLICATION_JSON_VALUE)
public ResponseEntity deleteRequestForm() {
return new ResponseEntity<>(HttpStatus.OK);
}
}
rest-dispatcher-spring.xml
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns="http://www.springframework.org/schema/beans"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.3.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.3.xsd">
<context:component-scan base-package="com.company.pbksb.web.resource"/>
</beans>
Thanks