Module: Openc::JsonSchema::Utils
Instance Method Summary collapse
- #extract_json_schema(validator) ⇒ Object
- #load_validator(schema_path, record, options = {}) ⇒ Object
Instance Method Details
#extract_json_schema(validator) ⇒ Object
20 21 22 |
# File 'lib/openc/json_schema/utils.rb', line 20 def extract_json_schema(validator) validator.instance_variable_get(:@base_schema) end |
#load_validator(schema_path, record, options = {}) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/openc/json_schema/utils.rb', line 6 def load_validator(schema_path, record, ={}) = { :record_errors => true, :errors_as_objects => true, :validate_schema => false } validator = JSON::Validator.new( schema_path, record, .merge() ) end |