interagent/prmd — pull request #111 by brandur (2014-05-23 22:15:34+00:00)
Title: Verification (`prmd verify`) with meta-schemas

After our conversation about meta schemas yesterday, I took a quick stab at implementation in Prmd. This pull takes the V4 JSON Schema, V4 JSON Hyper-schema, and "Interagent Hyper-schema" meta schemas and bundles them into a `schemas` directory in Prmd. When `prmd verify` is run, the `$schema` key is checked on the target schema, and appropriate validation is performed. [json_schema](https://github.com/brandur/json_schema) is used as the validation engine.

The one thing that we have to be careful of is that today's constraints have been moved to a new `$schema` value of `http://interagent.github.io/interagent-hyper-schema#` (URI up for debate BTW), and as such, they will not be applied to targets until those targets have updated their `$schema` accordingly. Until then they'll be validated against hyper-schema, which is much more forgiving.

The above is advantageous to non-Heroku Prmd users who would like to validation their schemas, but not to the same extent.

@geemus I guess the major question here is whether you'd be willing to edit a meta schema instead of today's more programmatic code. It makes adding new constraints very easy, but admittedly isn't the easiest thing in the world to read. I'm toying with the idea of converting it to YAML so that I can add comments to it.

I've also added comparisons of pre- and post-verify output on valid and invalid schemas.