-
Notifications
You must be signed in to change notification settings - Fork 18
Description
I was looking for an OCaml library to validate Yojson objects against a JSON schema and this library looks like the only one remotely related to that task. Unfortunately, I cannot figure out how to do it and am not suspecting it's not actually provided as a feature.
Json_schema does allow parsing JSON schemas from JSON objects themselves. Json_encoding implements all the validation rules, but that's on statically typed encodings, not arbitrary runtime schemas, which is what I want.
But there doesn't seem to be a way to convert a Json_schema.schema to any kind of Json_encoding.encoding, which would actually validate objects against the schema when destructing. There's custom, but that just stores the schema without checking.
Am I missing something or is it impossible to use this library for arbitrary schema validation?