Bash script to get API endpoints from spring-boot projects
1
I am writing a bash script to get API endpoints from a java file (maven spring-boot project). echo "$(grep -E '@RequestMapping' userAPI.java)" The above line extracted this following result: @RequestMapping(value = "/users/{userId}", produces = { "application/json" }, method = RequestMethod.GET) @RequestMapping(value = "/users/{userId}/applications", produces = { "application/json" }, method = RequestMethod.GET) My final goal is to get the two endpoints into two variables var1 = "GET /users/{userId}" var2 = "GET /users/{userId}/applications" Please advise what to do next based on the above result? Thanks. I am thinking to use grep and sed, or so on. As a simpler case, how can I just get the endpoints