| I don't think there's a correct answer, this is just an opinion I stumbled into this morning. The objective mostly was to try help form a way of reasoning about HTTP APIs from the consumer's perspective > error 400 for all semantically-invalid requests Counter point: Passing `a` to the example endpoint is not semantically-invalid from the perspective of HTTP, it's a perfectly valid URL. Nothing about that request is invalid, it's only invalid to the business layer, which has nothing to do with the HTTP layer. Put another way: The server _is_ processing the request, that's how it send back the "employee not found" record. I guess it depends where you want to draw the boundary of server. Which is not to say you are wrong if you return a 400, but I suspect you might get a couple queries about it from consumers. The objective was mostly about clarity. Maybe I'm being over-simplistic, but I like the idea of using protocol errors for protocol problems and domain errors for domain problems. Just keeps client-side logic cleaner in my experience |