The license of this project is LGPLv3 or later. See file src/main/resources/LICENSE for the full text.
The current version is 0.1.4.
This package contains two processors (see json-schema-core) to convert Avro schemas to JSON Schemas, and the reverse.
This processor can transform all Avro schemas you can think of, as long as said schemas are self contained. The generated JSON Schemas can accurately validate JSON representations of Avro data with two exceptions:
Note that this processor is demoed online here.
This processor is not complete yet. It is _much_ more difficult to write than the reverse for two reasons:
The generated Avro schemas are however reasonably good, and cover a very large subset of JSON Schema usages.
This processor is not available online yet; it will soon be.
While JSON Schema has minimum and maximum to enforce the minimum and maximum values of a JSON number, JSON numbers (RFC 4627, section 2.4) do not define any limit to the scale and/or precision of numbers.
That is a first reason, but then one should ask why then, are there limits for int and long. There are two reasons for this:
Defining limits would therefore not ensure that the JSON number being validated can indeed fit into the corresponding Avro type.
Replace your-version-here with the appropriate version:
<dependency>
<groupId>com.github.fge</groupId>
<artifactId>json-schema-avro</artifactId>
<version>your-version-here</version>
</dependency>