Skip to main content

ValidationError

Each entry in HTTPValidationError.detail describes one validation failure.

Key fields

  • loc: where the validation issue happened, such as ["header", "x-api-key"]
  • msg: human-readable explanation
  • type: machine-readable validation category
  • input: offending value when the framework includes it
loc
(string | integer)[]
required

Where the validation error occurred.

msg
string
required

Human-readable validation message.

type
string
required

Machine-readable validation error type.

input
any

The offending input value when available.