Hi team,
Could you please clarify the rationale for why FAILED_PRECONDITION in the canonical error model is mapped to HTTP 400 rather than HTTP 422 (Unprocessable Entity)?
From an HTTP semantics perspective:
- HTTP 400 typically indicates syntactically invalid requests.
- HTTP 422 is intended for requests that are syntactically correct but semantically invalid (e.g., domain rules violations).
Since FAILED_PRECONDITION often signals that the request is well-formed but violates a business rule or invariant, using 422 seems more aligned with HTTP semantics.
Is there a specific reason why 400 was chosen as the mapping?
Thanks for any insights you can share on this design decision.
Hi team,
Could you please clarify the rationale for why
FAILED_PRECONDITIONin the canonical error model is mapped to HTTP 400 rather than HTTP 422 (Unprocessable Entity)?From an HTTP semantics perspective:
Since
FAILED_PRECONDITIONoften signals that the request is well-formed but violates a business rule or invariant, using 422 seems more aligned with HTTP semantics.Is there a specific reason why 400 was chosen as the mapping?
Thanks for any insights you can share on this design decision.