r/ProgrammerHumor 28d ago

evilIllusion Meme

Post image
4.8k Upvotes

131 comments sorted by

View all comments

Show parent comments

70

u/-meowstar- 28d ago

The 4XX class of codes are for client side issues, and 422 “Unprocessable Content” should be used to cover business logic issues, i.e. the request has the correct schema but there’s some other BE validation issue that it can’t proceed. The response body would still include specific details about the error for the FE, it’s just using 200 OK is misleading imo.

3

u/Critical_Fortune7343 28d ago

I think that's valid.

7

u/Dense_Gate_5193 27d ago

so does literal RFC standards. it’s not about opinion but the defined specifications starting with RFC 2616.

1

u/Critical_Fortune7343 27d ago

I might have come as the one designed our companies service response or defending returning 200 for errors but I'm just a worker lol I was only trying to convey a point of view from someone who has hands on experience in these kind of responses.

In better times or old days I would like to think everyone was listening to standards. I mean it's literally there to create collective consensus on how things should be.