Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st. We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here. Need help or have questions? Drop us a line at [email protected]
Created on 03-27-201704:01 PM - edited 08-17-201901:37 PM
There are many ways to validate a json file against a avro schema to verify all is kosher. Sharing a practice I have been using for few years.
Objective - Validate avro schema well bound to the json file
First you must have a avro schema and json file. From there download the latest a avro-tools jar. At the moment 1.8.1 is the latest avro-tools version jar available.
Store the avro schema and json file in the same directory. Issue a wget to fetch the avro-tools jar
Now as a last step lets break something. Another avro schema (student2.avsc) is created which does not conform to student.json. Lets verify the avro-tools jar will fails to build a avro binary
As you can see from above output the avro binary failed to create due to validation errors