Class: SaraSchema::Validator

Inherits:
Object
  • Object
show all
Defined in:
lib/sara-schema/validator.rb,
lib/sara-schema/schema_not_found_error.rb

Defined Under Namespace

Classes: SchemaNotFoundError

Class Method Summary collapse

Class Method Details

.validate(schema, to_be_validated) ⇒ Object



13
14
15
# File 'lib/sara-schema/validator.rb', line 13

def validate(schema, to_be_validated)
  JSONSchemer.schema(path(schema)).valid?(to_be_validated)
end

.validate!(schema, to_be_validated) ⇒ Object



17
18
19
# File 'lib/sara-schema/validator.rb', line 17

def validate!(schema, to_be_validated)
  JSONSchemer.schema(path(schema)).validate(to_be_validated)
end