miner/herbert — pull request #1 by MaxDroogHayes (2014-07-08 15:35:52+00:00)
Title: Prismatic generation

I have been trying to generate example data which fits a specified Prismatic Schema. So my changes mean that a call to hg/generator can be passed a Prismatic schema such as (hg/generator {:name s/Str :number s/Int}).
The result of this can then be used with test.check generators and s/validate to check that the data conforms to the original schema. This is just a simple first attempt as it does not allow for schema predicates or optional keys, but it produces data which can be successfully validated against (nested) maps and vectors.
Unfortunately I am having to convert some of the inputs into strings in order to check them as I could not find a better way that would work with all data types in Prismatic Schema.
Hopefully this is a useful addition or can be improved on!