Julian/jsonschema — pull request #40 by boronine (2012-10-26 05:32:09+00:00)
Title: $ref support

Excellent work on jsonschema.

I implemented enough `$ref` support to satisfy our requirements by integrating JSON pointer (https://github.com/stefankoegl/python-json-pointer). When `$ref` is a URL, it fetches the JSON document not from the internet, but from a dictionary passed into the validator's constructor. I also wrote some very basic tests.

A couple of notes:

1. jsonpointer isn't packaged for Python 3.2

2. setup.py probably shouldn't import `__version__` from the module See https://bitbucket.org/hpk42/tox/issue/42/dependencies-should-be-installed-one-at-a

3. `validate_ref` depends on `self.schema` for local pointers. When `validate_ref` is run from `check_schema`, `self.schema` is not set. I wrote a workaround, not sure if it's kosher though. See https://github.com/boronine/jsonschema/blob/48655a50a8d7c119b5bff7b110c53cdfc91f0959/jsonschema.py#L205

`$ref` support isn't quite there yet, but I hope it will come soon!