PB.Validate.Violation (PB.Validate v0.2.0)

Copy Markdown View Source

Rich application-facing protovalidate violation.

This struct may contain more diagnostic information than the canonical buf.validate.Violation wire shape. Use PB.Validate.to_proto_violations/1 when an exact protobuf result is needed.

Summary

Types

A path to a field or rule, as buf.validate.FieldPath: a map with :elements, each describing one step.

t()

Types

field_path()

@type field_path() :: %{elements: [map()]}

A path to a field or rule, as buf.validate.FieldPath: a map with :elements, each describing one step.

t()

@type t() :: %PB.Validate.Violation{
  field: field_path() | nil,
  for_key: boolean() | nil,
  message: String.t() | nil,
  proto_rule: field_path() | nil,
  rule: field_path() | nil,
  rule_id: String.t(),
  source: String.t() | nil
}