class

UCL::Validator

Inherits Reference < Object

Validates a UCL/JSON document against a UCL/JSON schema using libucl's ucl_object_validate. Backs UCL.validate and UCL.valid?.

Class methods

validate(schema : String, string : String, flags = UCL::Parser::DEFAULT_FLAGS) : Bool

Parses both schema and string (with flags) and validates the data against the schema.

Returns true when valid, otherwise raises UCL::Error::SchemaError with the message reported by libucl.

Source