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 | Nil
- #contains=(contains : Validator | Nil)
- #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 : Bool)
- #items : Validator | Nil
- #items=(items : Validator | Nil)
- #max_contains : Int32 | Nil
- #max_contains=(max_contains : Int32 | Nil)
- #max_items : Int32 | Nil
- #max_items=(max_items : Int32 | Nil)
- #min_contains : Int32 | Nil
- #min_contains=(min_contains : Int32 | Nil)
- #min_items : Int32 | Nil
- #min_items=(min_items : Int32 | Nil)
- #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 : Bool)
- #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"}}