This slideshare is wrong: you cannot obtain JSON Schema instances from
an instance being validated. This is not the kind of constraint which
can be enforced by JSON Schema.
A $ref in JSON Schema is to be interpreted as a JSON Reference and its
contents unconditionally replaced with what the $ref points to (and
note that it may not even be a JSON document to begin with). But a
JSON Reference _cannot_ point to parts of the instance being validated
-- unless your instance is accessible via an absolute URI.. Should JSV
be able to do that, it would do so outside the JSON Schema spec
itself. It is not guaranteed _at all_ that it will work with any other
conforming JSON Schema implementation.
What's more, the slide you point out to also falls short in several
ways of conforming to the JSON Schema specification at all (it assumes
Javascript in too many places, JSON Schema is language independent).
In summary: can you try and formalize your problem? The solution may
(or may not) be implemented using JSON Schema proper.
--
Francis Galiegue,
fgal...@gmail.com
"It seems obvious [...] that at least some 'business intelligence'
tools invest so much intelligence on the business side that they have
nothing left for generating SQL queries" (Stéphane Faroult, in "The
Art of SQL", ISBN 0-596-00894-5)