Python jsonschema.validators.RefResolver() Examples

The following are code examples for showing how to use jsonschema.validators.RefResolver(). They are from open source Python projects. You can vote up the examples you like or vote down the ones you don't like.

Example 1
Project: openapi-core   Author: p1c2u   File: shortcuts.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def create_spec(spec_dict, spec_url=''):
    spec_resolver = RefResolver(
        spec_url, spec_dict, handlers=default_handlers)
    spec_factory = SpecFactory(spec_resolver)
    return spec_factory.create(spec_dict, spec_url=spec_url) 
Example 2
Project: openapi-core   Author: p1c2u   File: test_schemas_registry.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def dereferencer(self, spec_dict):
        spec_resolver = RefResolver('', spec_dict, handlers=default_handlers)
        return Dereferencer(spec_resolver)