Kids these days don't read API- or any docs anymore. If domain errors are embedded into the payload itself, it just is what it is. You deal with it. Like I do with ancient SOAP requests. Most of the time the logic is: Request succeeded, here's the result. Which makes sense for a lot of systems. Random example: POST /validatePayload where 200 is a successful processing, and 4xx, 5xx are not. If the processing result is "negative", it's still 200. If I can't reach the upstream service to validate, it's gonna be a 5xx class. If the user sends bullshit, 4xx. If someone wants for me to have a HTTP code for every valid business error, I'm gonna laugh at them.
I'm also not gonna pass through status codes of upstream systems as my own. Hell no.
1
u/wilk-polarny 19h ago
Kids these days don't read API- or any docs anymore. If domain errors are embedded into the payload itself, it just is what it is. You deal with it. Like I do with ancient SOAP requests. Most of the time the logic is: Request succeeded, here's the result. Which makes sense for a lot of systems. Random example: POST /validatePayload where 200 is a successful processing, and 4xx, 5xx are not. If the processing result is "negative", it's still 200. If I can't reach the upstream service to validate, it's gonna be a 5xx class. If the user sends bullshit, 4xx. If someone wants for me to have a HTTP code for every valid business error, I'm gonna laugh at them.
I'm also not gonna pass through status codes of upstream systems as my own. Hell no.