Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Plain View
Avro >> mail # user >> An experiment: Avro schema to JSON Schema conversion

Copy link to this message
An experiment: Avro schema to JSON Schema conversion

I've had a little fun and could make a full Avro Schema to JSON Schema
conversion processor:


It uses the Avro Java library to parse the schema, and a series of
"translators" then translate each Avro type to their matching JSON

All Avro schemas you can think of can be translated, with the current
limitation that they must be self contained. In the future, I'll split
this processor into its own package and maybe add support for Avro
schema "bundles".

Interesting note: since the output of the processor is an input for
the validation chain of my Java JSON Schema validation library, it
means you can use an Avro schema and validate JSON data directly using
the generated JSON Schemas! Fun, I tell you.

Francis Galiegue, [EMAIL PROTECTED]
JSON Schema in Java: http://json-schema-validator.herokuapp.com