From bcaa062855a634b980f47a2034431aaed1aeca40 Mon Sep 17 00:00:00 2001 From: Ben Webb Date: Wed, 14 Dec 2022 14:51:08 +0000 Subject: [PATCH] Disable jsonref --- compiletojsonschema/compiletojsonschema.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/compiletojsonschema/compiletojsonschema.py b/compiletojsonschema/compiletojsonschema.py index b03d6d1..d996f41 100644 --- a/compiletojsonschema/compiletojsonschema.py +++ b/compiletojsonschema/compiletojsonschema.py @@ -5,8 +5,6 @@ from collections import OrderedDict from copy import deepcopy -import jsonref - class CompileToJsonSchema: def __init__( @@ -31,15 +29,12 @@ def __init__( def get(self): if self.input_filename: with open(self.input_filename) as fp: - resolved = jsonref.load( + resolved = json.load( fp, object_pairs_hook=OrderedDict, - base_uri=pathlib.Path( - os.path.realpath(self.input_filename) - ).as_uri(), ) elif isinstance(self.input_schema, dict): - resolved = jsonref.JsonRef.replace_refs(self.input_schema) + resolved = self.input_schema else: raise Exception("Must pass input_filename or input_schema")