JSONSchema::StringValidator
Inherits JSONSchema::ValidatorRender / Reference / Object
Validates schema where the type is string.
This is a raw Validator class that you most likely do not need to use directly.
See the JSONSchema#create_validator macro, JSONSchema#from_json, or JSONSchema.fluent for common usage of this shard.
Instance methods
composites
Sourceenum_list
Sourceformat
Sourcemax_length
Sourcemin_length
Sourcepattern
Sourceto_cr
Sourceto_json(json : JSON::Builder)
Serialize the validator into its string representation.
js = JSONSchema.fluent
validator = js.string do
min_length 10
end
validator.to_json # => {"type":"string","minLength":10}