A server MUST respond with 404 Not Found when processing a request to fetch a single resource that does not exist, except when the request warrants a 200 OK response with null as the primary data (as described above).
The "described above" refers to the previous section of the specification :
A server MUST respond to a successful request to fetch an individual resource with a resource object or null provided as the response document's primary data.
null is only an appropriate response when the requested URL is one that might correspond to a single resource, but doesn't currently.
I don't understand when I need to return a HTTP 404 Not Found and when I need with HTTP 200 OK with
For example, if I have the following URL :
This URL is correct, but the User referenced by the ID 52 doesn't exist.What is the correct response ? A 404 or a 200
data: null ?