I'm in the process of modernizing and transforming a legacy monolith application that runs in Spring
on Jetty
into a Spring Boot
application.
In the legacy code, I have an endpoint that looks like that:
@POST
@Produces({MediaType.APPLICATION_JSON})
@Consumes({MediaType.APPLICATION_JSON})
@Path("/zoo/feedCats")
@WebMethod
public Response giveFood( @Context UriInfo uri, HungryCats hungryCats){...}
And the first draft of the new endpoint in Spring Boot
looks like that:
@PostMapping("/zoo/feedCats")
public Response giveFood( UriInfo uri , @RequestBody HungryCats hungryCats) {...}
I'm not sure what should be the right replacement for the @Context UriInfo uri
that is in the legacy code.
I found this post from 2016 and was wondering if there is something else to use?