class JoobQ::APIValidation::ValidationResult

Overview

Validation result container

Included Modules

Defined in:

joobq/api_validation.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(pull : JSON::PullParser) #

[View source]
def self.new(valid : Bool, errors : Array(ValidationError) = [] of ValidationError, data : JSON::Any | Nil = nil) #

[View source]

Instance Method Detail

def add_error(field : String, message : String, value : JSON::Any | Nil = nil, code : String = "validation_error") #

[View source]
def data : JSON::Any | Nil #

[View source]
def data=(value : JSON::Any | Nil) #

[View source]
def error_response : Hash(String, JSON::Any) #

[View source]
def errors : Array(ValidationError) #

[View source]
def success? #

[View source]
def valid : Bool #

[View source]