Search code examples
springspring-boottomcat

Listing all deployed rest endpoints (spring-boot, tomcat)


I know there is a similar kind of question exist but if works only for glassfish server.

Listing all deployed rest endpoints (spring-boot, jersey)

Is it possible to list all my configured rest-endpoints with spring boot? The actuator lists all existing paths on startup, I want something similar for my custom services, so I can check on startup if all paths are configured correctly and use this info for client calls.

How do I do this? I use @Path/@GET annotations on my service beans and register them via ResourceConfig#registerClasses.

Is there a way to query the Config for all Paths?

Update2: I want to have something like

GET /rest/mycontroller/info
POST /res/mycontroller/update

...


Solution

  • This can be easily done via swagger.

    After configuring your server with swagger. you can use /v2/api-docs to retrieve all your API endpoints.

    you can also use swagger-UI to test endpoints like postman.