Skip to content

Rationale for Mapping FAILED_PRECONDITION to HTTP 400 Instead of 422 #1534

@yordis

Description

@yordis

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions