Return a 404 when a resource is not found in Spring Boot
Your URL path isn't very RESTlike. You have built the URL to describe an operation when a more common approach is to build the URL to describe a resource.

So instead of https://example.com/api/mappings/get-by-id/42 one would build a URL like https://example.com/api/mappings/42.

The name get-by-id is fully redundant in REST world as the "get" operation is already defined in the HTTP GET-method (the @GetMapping annotation in Spring Boot) and identifying resources by their identifier is always the default operation :).