class UCL::Validator

Overview

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

Defined in:

ucl/validator.cr

Class Method Summary

Class Method Detail

def self.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.


[View source]