class JSONSchema::ArrayValidator
- JSONSchema::ArrayValidator
- Reference
- Object
Overview
Validates schema where the type
is array
.
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.
Included Modules
Defined in:
render.crserialize.cr
validator.cr
Instance Method Summary
- #composites : Array(CompositeValidator)
- #composites=(composites : Array(CompositeValidator))
- #contains : Validator?
- #contains=(contains : Validator?)
- #enum_list : Array(JSON::Any)
- #enum_list=(enum_list : Array(JSON::Any))
- #has_disabled_additional_items : Bool
- #has_disabled_additional_items=(has_disabled_additional_items)
- #items : Validator?
- #items=(items : Validator?)
- #max_contains : Int32?
- #max_contains=(max_contains : Int32?)
- #max_items : Int32?
- #max_items=(max_items : Int32?)
- #min_contains : Int32?
- #min_contains=(min_contains : Int32?)
- #min_items : Int32?
- #min_items=(min_items : Int32?)
- #prefix_items : Array(Validator)
- #prefix_items=(prefix_items : Array(Validator))
- #to_cr
-
#to_json(json : JSON::Builder)
Serialize the validator into its string representation.
- #unique_items : Bool
- #unique_items=(unique_items)
- #validate(node : JSON::Any, context = NodeContext.new)
Instance Method Detail
def to_json(json : JSON::Builder)
#
Serialize the validator into its string representation.
js = JSONSchema.fluent
validator = js.array do
items js.string
end
validator.to_json # => {"type":"array","items":{"type":"string"}}