class JSONSchema::ObjectValidator
- JSONSchema::ObjectValidator
- Reference
- Object
Overview
Validates schema where the type
is object
.
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
- #additional_properties : Validator | Nil
- #additional_properties=(additional_properties : Validator | Nil)
- #composites : Array(CompositeValidator)
- #composites=(composites : Array(CompositeValidator))
- #dependent_required : Hash(String, Array(String))
- #dependent_required=(dependent_required : Hash(String, Array(String)))
- #dependent_schemas : Hash(String, ObjectValidator)
- #dependent_schemas=(dependent_schemas : Hash(String, ObjectValidator))
- #enum_list : Array(JSON::Any)
- #enum_list=(enum_list : Array(JSON::Any))
- #has_disabled_additional_properties : Bool
- #has_disabled_additional_properties=(has_disabled_additional_properties : Bool)
- #max_properties : Int32 | Nil
- #max_properties=(max_properties : Int32 | Nil)
- #min_properties : Int32 | Nil
- #min_properties=(min_properties : Int32 | Nil)
- #pattern_properties : Hash(Regex, Validator)
- #pattern_properties=(pattern_properties : Hash(Regex, Validator))
- #properties : Hash(String, Validator)
- #properties=(properties : Hash(String, Validator))
- #property_names : StringValidator | Nil
- #property_names=(property_names : StringValidator | Nil)
- #required : Array(String) | Nil
- #required=(required : Array(String) | Nil)
- #to_cr
-
#to_json(json : JSON::Builder)
Serialize the validator into its string representation.
- #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.object do
prop "name", js.string
end
validator.to_json # => {"type":"object","properties":{"name":{"type":"string"}}}