diff options
Diffstat (limited to 'tools/json_schema_compiler/previewserver.py')
-rwxr-xr-x | tools/json_schema_compiler/previewserver.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/json_schema_compiler/previewserver.py b/tools/json_schema_compiler/previewserver.py index 8a6f6ab..384171e 100755 --- a/tools/json_schema_compiler/previewserver.py +++ b/tools/json_schema_compiler/previewserver.py @@ -11,7 +11,7 @@ import code import cpp_type_generator import cpp_util import h_generator -from json_schema import LoadJSON +import json import model import optparse import os @@ -188,7 +188,8 @@ updateEverything(); try: # Get main json file - api_defs = LoadJSON(json_file_path) + with open(json_file_path) as json_file: + api_defs = json.loads(json_file.read()) namespace = api_model.AddNamespace(api_defs[0], json_file_path) if not namespace: body.Append("<pre>Target file %s is marked nocompile</pre>" % @@ -200,7 +201,8 @@ updateEverything(); # Get json file depedencies for dependency in api_defs[0].get('dependencies', []): json_file_path = os.path.join(filedir, dependency + '.json') - api_defs = LoadJSON(json_file_path) + with open(json_file_path) as json_file: + api_defs = json.loads(json_file.read()) referenced_namespace = api_model.AddNamespace(api_defs[0], json_file_path) if referenced_namespace: |