Finally Found You
I spent most of last night setting up a project to experiment using this client library with my own Hyper Schema Hypermedia API (http://www.passportedu.com/api/v1). Tonight I plan to get pretty hot and heavy with Eric's library and get some working examples of how I can use it in my own project. It seems like it works just as I would have designed it.
It creates a Correlation between schema and instance
For each endpoint you provide to the suite, it produces what it calls a correlation. A correlation is the result of interpolating the resource instances with the resource schema. Here is just a teaser of some of the functionality offered by a correlation.
correlation.validate() Validates correlation instance against correlation schema. NOTE: validation errors are inaccessible here; if you need them, use the standalone validate().
correlation.resolveLinks() Validates, and builds a links object, concatenating all link specifications from all valid schemas. Links are then resolved against the correlation instance. Typically this method is not called directly but instead via correlation.links(), defined in json-schema-hyper.
correlation.subschema() Validates, and builds a 'collated' schema (Schema.allOf) for the given property/array-index from all valid schemas. Note if only one valid schema (the "top-level schema"), the behavior is identical to the basic subschema() method provided in json-schema-core.
correlation.coerce() Validates, and coerces instance according to: (1) the first valid schema that specifies either `type` or `default` or both; (2) the "top-level schema", otherwise, whether instance is valid or invalid. NOTE: that the ordering of valid schemas cannot be relied on, so it is recommended that either the top-level schema specify type and/or default, or _only one_ combination schema specify these.
Just the beginning
I plan to dive deep into this library and learn as much as I can. I'll keep this blopg posted with my progress, however big or small.