Customer Rest Controller Not Showing in Swagger

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

Hi.
As I can see, your rest-dispatcher-spring.xml file content does not contain the information specified in the documentation as mandatory. Сheck the fulfillment of conditions of points 2 and 3.

Regards,
Natalia

Thanks for your reply,

I copied rest-dispatcher-spring.xml from the documentation still doesn’t show on swagger
Though, I am able to test the API using CURL.

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:context="http://www.springframework.org/schema/context"
       xmlns:security="http://www.springframework.org/schema/security"
       xmlns="http://www.springframework.org/schema/beans">

    <!-- Define a base package for your controllers-->
    <context:component-scan base-package="com.company.pbksb.web.resource"/>


    <security:http pattern="/rest/test-api/**"
                   create-session="stateless"
                   entry-point-ref="oauthAuthenticationEntryPoint"
                   xmlns="http://www.springframework.org/schema/security">
        <!-- Specify one or more protected URL patterns-->
        <intercept-url pattern="/rest/myapi/**" access="isAnonymous()"/>
        <anonymous enabled="true"/>
        <csrf disabled="true"/>
        <cors configuration-source-ref="cuba_RestCorsSource"/>
        <custom-filter ref="resourceFlter" before="PRE_AUTH_FILTER"/>
        <custom-filter ref="cuba_AnonyimousAuthenticationFilter" after="PRE_AUTH_FILTER"/>
    </security:http>
</beans>

I also updated web-app.properties to include the

cuba.restSpringContextConfig = +com/company/pbksb/rest-dispatcher-spring.xml