class
JoobQ::APIValidation::ValidationResult
- JoobQ::APIValidation::ValidationResult
- Reference
- Object
Overview
Validation result container
Included Modules
Defined in:
joobq/api_validation.crConstructors
- .new(pull : JSON::PullParser)
- .new(valid : Bool, errors : Array(ValidationError) = [] of ValidationError, data : JSON::Any | Nil = nil)
Instance Method Summary
- #add_error(field : String, message : String, value : JSON::Any | Nil = nil, code : String = "validation_error")
- #data : JSON::Any | Nil
- #data=(value : JSON::Any | Nil)
- #error_response : Hash(String, JSON::Any)
- #errors : Array(ValidationError)
- #success?
- #valid : Bool
Constructor Detail
def self.new(valid : Bool, errors : Array(ValidationError) = [] of ValidationError, data : JSON::Any | Nil = nil)
#
Instance Method Detail
def add_error(field : String, message : String, value : JSON::Any | Nil = nil, code : String = "validation_error")
#