[erlang-questions] Jesse - a JSON schema validator in Erlang

Anton Lavrik <>
Thu Feb 21 07:18:13 CET 2013


On Wed, Feb 20, 2013 at 12:30 PM, Motiejus Jakštys
<> wrote:
> On Wed, Feb 20, 2013 at 4:18 PM, Igor Karymov <> wrote:
>> Another approach of scheme definition that can work with json:
>> https://github.com/alavrik/piqi

Piqi does support working from JSON from Erlang and does it really
well. For example, when it finds a problem, it returns a description
of it and points to the exact line:column location in the input.

Because it is more of a data serialization system, Piqi doesn't
support a jesse-like interface for validating JSON dynamically, but it
can be added. If anybody is interested, please let me know.

> In the end, I would love a piqi-to-xsd and piqi-to-json-schema
> converters. That would allow to use piqi in corporate environments
> (a.k.a. where xml and xsd are mandatory), and with more flexible
> clients that use json, which you could pass the JSON schema, requiring
> much less manual documentation.

piqi to X conversion can be done fairly easily. First, Piqi
specification is stable, small and extensible. Essentially, it has a
reasonably small but very powerful set of types that can be mapped to
pretty much anything. Second, nobody needs to parse .piqi Just run
"piqi compile -t json|pb|xml <.piqi>" and read JSON, XML or Protocol
Buffers output using any language. (The "piqi" command is a standalone
statically linked program).

Anton



More information about the erlang-questions mailing list