class Amber::Schema::ValidationFailure

Overview

Base class for validation errors (contains multiple field errors)

Defined in:

amber/schema/result.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(errors : Array(Error), raw_data : Hash(String, JSON::Any) | Nil = nil, warnings : Array(Warning) = [] of Warning) #

[View source]

Instance Method Detail

def errors : Array(Error) #

[View source]
def errors_by_field : Hash(String, Array(Error)) #

Get errors grouped by field


[View source]
def errors_for_field(field : String) : Array(Error) #

Get errors for specific field


[View source]
def has_error_for_field?(field : String) : Bool #

Check if specific field has errors


[View source]
def messages : Array(String) #

Get all error messages as strings


[View source]
def raw_data : Hash(String, JSON::Any) | Nil #

[View source]
def to_h #

Convert to hash for JSON serialization


[View source]
def to_s(io) #

Human-readable error summary


[View source]
def warnings : Array(Warning) #

[View source]