app.validation_messages

Readable, secret-free messages for pydantic validation errors.

Configuration problems are shown to operators (check-config, startup log, /api/v1/sources). describe_validation_error() renders each error as <location>: <message> and deliberately leaves out the offending input values, which could be secrets.

Public API: describe_validation_error().

app.validation_messages.describe_validation_error(exc, prefix='')

Render a validation error without echoing input values.

Parameters:
  • exc (ValidationError) – The pydantic error.

  • prefix (str) – Location prefix such as sources[0].

Return type:

str

Returns:

"<loc>: <msg>; <loc>: <msg>".