Say the client is requesting the following URL:
/user-details?user=123
If /user-details
was a non-existing resource, the corre
The 404 is fine because the user-details resource is a conceptual mapping to the user entity in this case to a partial user resource information.
The GET method for user-details is therefore not responsible for differentiating from the two cases: a) The user doesn't exist, b) The user details don't exist.
I would however rewrite the endpoint to something like this:
/user/123/details
Which in my opinion is more expressive.