nickcmaynard / jsonschemalint

JSON Schema Lint. Like you I'm busy, so pull requests will get merged quicker than feature requests are implemented.
https://jsonschemalint.com
MIT License
80 stars 31 forks source link

Add support for JSON Schema draft v5 features #8

Closed HotelDon closed 8 years ago

HotelDon commented 8 years ago

The proposal for version 5 of the JSON schema is not yet finalized. As such, support for specific v5 features is subject to change. Currently, Ajv supports all validation keywords and the $data reference type.

HotelDon commented 8 years ago

A quick summary of the changes I made:

1) Added /draft5 folder. It's mostly a copy of /draft4, except now ValidatorController uses Ajv for validating, since it has draft5 support. 2) Updated the intro text on index.html, and also updated the error display code because Ajv formats its errors slightly differently. 3) I also updated the draft4's index.html to have a link to /draft5. 4) No meta-schema folder in draft5, because Ajv has hard coded functions for validating schemas. 5) Updated draft5's samples to use some v5 only features, just to show they work.

That's all the major stuff. The only problem I ran into was the formatting of the error messages having either too much or not enough padding. I wasn't sure what the best way to fix that was without breaking everything.

nickcmaynard commented 8 years ago

Thank you @HotelDon!