class OpenApi::PrimitiveValidator

Defined in:

validators/primitive_validator.cr

Constant Summary

EXCLUSIVE_MAX_NUMBER_ERROR = "invalid value for \"%s\", the character length must be smaller than %s."
EXCLUSIVE_MIN_NUMBER_ERROR = "invalid value for \"%s\", the character length must be greater than %s."
MAX_ITEMS_ERROR = "invalid value for \"%s\", number of items must be smaller than or equal to %s."
MAX_LENGTH_ERROR = "invalid value for \"%s\", the character length must be smaller than or equal to %s."
MAX_NUMBER_ERROR = "invalid value for \"%s\", must be smaller than or equal to %s."
MIN_ITEMS_ERROR = "invalid value for \"%s\", number of items must be greater than or equal to %s."
MIN_LENGTH_ERROR = "invalid value for \"%s\", the character length must be greater than or equal to %s."
MIN_NUMBER_ERROR = "invalid value for \"%s\", must be greater than or equal to %s."
PATTERN_ERROR = "invalid value for \"%s\", must conform to the pattern %s."

Class Method Summary

Class Method Detail

def self.max_items_error(name : String, value : Int, max : Int) : String | Nil #

[View source]
def self.max_length_error(name : String, length : Int, max : Int) : String | Nil #

[View source]
def self.max_number_error(name : String, value : Number, max : Number, exclusive : Bool = false) : String | Nil #

[View source]
def self.min_items_error(name : String, value : Int, min : Int) : String | Nil #

[View source]
def self.min_length_error(name : String, length : Int, min : Int) : String | Nil #

[View source]
def self.min_number_error(name : String, value : Number, min : Number, exclusive : Bool = false) : String | Nil #

[View source]
def self.pattern_error(name : String, value : String, pattern : Regex) : String | Nil #

[View source]
def self.validate_max_items(name : String, value : Int, max : Int) : Nil #

[View source]
def self.validate_max_length(name : String, length : Int, max : Int) : Nil #

[View source]
def self.validate_max_number(name : String, value : Number, max : Number, exclusive : Bool = false) : Nil #

[View source]
def self.validate_min_items(name : String, value : Int, min : Int) : Nil #

[View source]
def self.validate_min_length(name : String, length : Int, min : Int) : Nil #

[View source]
def self.validate_min_number(name : String, value : Number, min : Number, exclusive : Bool = false) : Nil #

[View source]
def self.validate_pattern(name : String, value : String, pattern : Regex) : Nil #

[View source]