JSON-Schema

npm tv4
grunt-tv4
tv4-reporter
chai-json-schema

As an ex-ActionScripter I miss runtime validation in JavaScript (TypeScript), so I got involved in a JSON-Schema validator.

TV4

At that point the best schema validator for JavaScript was the tv4 package. While the project itself was a very low-tech, with no clear reproducible build/test-script, concatenation running in PHP (!) and the tests themselves in a home-rolled script. I proposed moving it to Grunt and mocha, and on a big pull request the owner made me contributor with Github push access.

I converted the whole test suite to mocha + chai (now proclaim), added grunt, a minifier, JSHint. Then created node.js and phantomJS tests, Travis-CI integration, readme badges, source-map-support. The whole shebang that makes it testable and easily reproducible with a simple npm install.

It paid off too, as it was now a lot easier for people to contribute when then can run the suite locally, and pull requests get tested on Travis-CI. This expanded the feature-set and slowly grows the users on npm, bower and component-io.

I don't have much code in the functional part of the module, just some usability/API stuff, but still keep an eye on it and do some infrastructure work. Recently I managed a user adding AMD (UMD) support with browser tests, easy to add when grunt was running phantomJS already.

Dependents

Grunt-tv4 is my own plugin that uses tv4 to validate values. There is a decent amount of code for a grunt-plugin, but it is quite capable and can load remote reference and bulk-reports errors in a fancy compact format using tv4-reporter.

Chai-json-schema is a plugin for chai that adds assertions for JSON-Schema.