You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think the docs and error handling would benefit from explicitly writing that the base_uri parameter must be set to the directory of the file that has references in it. I tried to set base_uri to the directory of the file from which to inject references, and that caused the program to crash. Took me a couple of hours to isolate the issue. I'm not sure if this is expected behavior or not, but in any case it is not apparent from the docs or the error. You can see the error thrown in example 2 below.
Traceback (most recent call last):
File "/Library/Python/3.9/site-packages/jsonref.py", line 179, in resolve_pointer
document = document[part]
KeyError: 'cat'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/<username>/pythonProject2/main.py", line 6, in <module>
print(config)
File "/Library/Python/3.9/site-packages/proxytypes.py", line 121, in wrapper
return method(self, *args, **kwargs)
File "/Library/Python/3.9/site-packages/jsonref.py", line 199, in __repr__
return repr(self.__subject__)
File "/Library/Python/3.9/site-packages/proxytypes.py", line 163, in __getattribute__
return _oga(self, attr)
File "/Library/Python/3.9/site-packages/proxytypes.py", line 121, in wrapper
return method(self, *args, **kwargs)
File "/Library/Python/3.9/site-packages/proxytypes.py", line 243, in __subject__
self.cache = super(LazyProxy, self).__subject__
File "/Library/Python/3.9/site-packages/proxytypes.py", line 121, in wrapper
return method(self, *args, **kwargs)
File "/Library/Python/3.9/site-packages/proxytypes.py", line 227, in __subject__
return self.callback()
File "/Library/Python/3.9/site-packages/proxytypes.py", line 121, in wrapper
return method(self, *args, **kwargs)
File "/Library/Python/3.9/site-packages/jsonref.py", line 140, in callback
result = self.resolve_pointer(base_doc, fragment)
File "/Library/Python/3.9/site-packages/proxytypes.py", line 121, in wrapper
return method(self, *args, **kwargs)
File "/Library/Python/3.9/site-packages/jsonref.py", line 181, in resolve_pointer
raise self._error(
jsonref.JsonRefError: Error while resolving `file:///Users/<username>/file-b.json#/cat`: Unresolvable JSON pointer: '/cat'
Process finished with exit code 1
The text was updated successfully, but these errors were encountered:
I think the docs and error handling would benefit from explicitly writing that the
base_uri
parameter must be set to the directory of the file that has references in it. I tried to set base_uri to the directory of the file from which to inject references, and that caused the program to crash. Took me a couple of hours to isolate the issue. I'm not sure if this is expected behavior or not, but in any case it is not apparent from the docs or the error. You can see the error thrown in example 2 below.Assuming we have 2 files:
Example 1
/project/folder/file-a.json
:/project/file-b.json
:/project/main.py
output:
{'bat': 'hat'}
Example 2
/project/folder/file-a.json
:/project/file-b.json
:unchanged
/project/main.py
expected output:
{'bat': 'hat'}
actual:
The text was updated successfully, but these errors were encountered: