smart_schema
smart_schema copied to clipboard
[schema-definition] `empty` directive that allows some additional values to any type
data = { "a" => "x", "b" => "" }
# Pseudo-Code
SmartTypes::Value::Enum => ["x", "y", "z"] # our enum type
# some part of scheme that validates "b" key
required(:b).type(our-enum-type).empty("") # empty allows a series of values. empty allows different types
should allow data