class OpenApi::EnumValidator

Defined in:

validators/enum_validator.cr

Constant Summary

ERROR_MESSAGE = "invalid value for \"%s\", must be one of %s."

Class Method Summary

Class Method Detail

def self.valid?(values : Array(T) | Nil, allowable_values : StaticArray, allow_nil : Bool = true) : Bool forall T #

[View source]
def self.valid?(hash : Hash(U, T) | Nil, allowable_values : StaticArray, allow_nil : Bool = true) : Bool forall T, U #

[View source]
def self.valid?(value : T | Nil, allowable_values : StaticArray, allow_nil : Bool = true) : Bool forall T #

[View source]
def self.validate(name : String, values : Array(T) | Nil, allowable_values : StaticArray, allow_nil : Bool = true) : Nil forall T #

[View source]
def self.validate(name : String, hash : Hash(U, T) | Nil, allowable_values : StaticArray, allow_nil : Bool = true) : Nil forall T, U #

[View source]
def self.validate(name : String, value : T | Nil, allowable_values : StaticArray, allow_nil : Bool = true) : Nil forall T #

[View source]