class JSONSchema::ObjectValidator

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.cr
serialize.cr
validator.cr

Instance Method Summary

Instance Method Detail

def additional_properties : Validator? #

[View source]
def additional_properties=(additional_properties : Validator?) #

[View source]
def composites : Array(CompositeValidator) #

[View source]
def composites=(composites : Array(CompositeValidator)) #

[View source]
def dependent_required : Hash(String, Array(String)) #

[View source]
def dependent_required=(dependent_required : Hash(String, Array(String))) #

[View source]
def dependent_schemas : Hash(String, ObjectValidator) #

[View source]
def dependent_schemas=(dependent_schemas : Hash(String, ObjectValidator)) #

[View source]
def enum_list : Array(JSON::Any) #

[View source]
def enum_list=(enum_list : Array(JSON::Any)) #

[View source]
def has_disabled_additional_properties : Bool #

[View source]
def has_disabled_additional_properties=(has_disabled_additional_properties) #

[View source]
def max_properties : Int32? #

[View source]
def max_properties=(max_properties : Int32?) #

[View source]
def min_properties : Int32? #

[View source]
def min_properties=(min_properties : Int32?) #

[View source]
def pattern_properties : Hash(Regex, Validator) #

[View source]
def pattern_properties=(pattern_properties : Hash(Regex, Validator)) #

[View source]
def properties : Hash(String, Validator) #

[View source]
def properties=(properties : Hash(String, Validator)) #

[View source]
def property_names : StringValidator? #

[View source]
def property_names=(property_names : StringValidator?) #

[View source]
def required : Array(String)? #

[View source]
def required=(required : Array(String)?) #

[View source]
def to_cr #

[View source]
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"}}}

[View source]
def validate(node : JSON::Any, context = NodeContext.new(".")) #

[View source]