helix90
Joined 8 years ago
Karma
31
Submissions
13
Member since
Jul 30
Joined 8 years ago
Changing specialties is rough, but I have done it more than once. Embedded is a strange space, but you can break in.
The answer is either way, and it depends on the tooling you are using. If you are relying on a client library that doesn't handle HTTP errors in the way you want, then you return a 200 - OK {"error": "bad request"}. If the client library does what you want, then returning a limited selection of 4xx errors is very useful for letting the client know what happened quickly and easily.
Personally, I default to using the HTTP error codes. But I know that some really large companies don't agree, and always return a 200 OK to any valid request.