0
votes

I have a URI string inside the request that I am supposed to make. How to extract it and write a proper controller.

markerURI = marker://markerType/markerValue

Request: POST /books/123/markers/marker://big/yellow

I have written below rest controller for the above request:

@PostMapping("/books/{id}/markers/{markerURI:^marker.*}") 
public void assignMarker(
    @PathVariable("id") String id,
    @PathVariable("markerURI") String markerURI
)

but i'm not able to get markerURI=/marker://big/yellow inside markerURI variable. The request show 404 Not found error. Is there any way to do this. It's a requirement so can't do any hacks.