stefankoegl / python-json-pointer

Resolve JSON Pointers in Python
https://python-json-pointer.readthedocs.org/
Other
140 stars 43 forks source link

Ability to control how verbose the JsonPointerException is #51

Open shaybensasson opened 2 years ago

shaybensasson commented 2 years ago

Hi, Love this library.

I'm using it for JsonPointing to an element inside a JSON schema. My schema files could be ~10k lines. When a member is not found, this line formats (and dumps) the entire doc inside the message via this line:

raise JsonPointerException("member '%s' not found in %s" % (part, doc))

It would be wonderful to control the dumping of the doc to the exception message (e.g. Enabled by default, Disabled otherwise - in this case just the member is formatted).

Thanks