JSON Schema validator for Elixir, drafts 4, 6 and 7
open sourceMITfree
ex_json_schema is a JSON Schema validator for Elixir that supports drafts 4, 6 and 7 and passes the official JSON Schema Test Suite. It resolves schemas once for reuse, can fetch remote schemas through a resolver function you register, validates against a fragment of a schema, and returns errors as message and path tuples, as raw error structs or through your own formatter. It supports draft 4's formats and lets you add custom formats.
Problems it solves
- validate JSON against a JSON Schema in Elixir
- get detailed JSON Schema validation errors with paths in Elixir
- check request payloads against a schema in a Phoenix app
Features
- validates JSON Schema drafts 4, 6 and 7; passes the official test suite
- remote schema resolution through a resolver function you register
- validation against a fragment of a schema
- string, raw or custom error formatters
- draft 4 formats and custom formats
Limitations
- Of draft 4's formats it doesn't support uri, whose requirements in the official test suite its maker calls confusing or broken.1
Alternatives
The same job
These do what ex_json_schema does.
- check-jsonschema JSON Schema validation CLI and pre-commit hooks
