Uh oh!
There was an error while loading. Please reload this page.
validate_json_schema() function - #23
Conversation
mikeAdamss
left a comment
There was a problem hiding this comment.
few comments but this is mostly there
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| else: | ||
| error_location = "JSON data" | ||
| # Create formatted message to be output on ValidationError | ||
| if error_msg or indent: |
There was a problem hiding this comment.
Will this work as if error_msg is None or indent is None: to allow default kwargs of None?
My thinking is, I think this all makes sense and won't interfere with things, but we don't 100% know until we get into structured logs and the like, so I'm keen for a default behaviour of exactly what jsonschema usually does (so its obvious to a DE how to turn off the prettiness if they need to).
There was a problem hiding this comment.
Yup, this works - json.dumps default for indent is None.
validate_json_schema()added with tests. Function accepts schema as str, and data to be validated against schema as str or dict. Users can also include an optionalmsg(str) and specify the integer value to indent json output.TODO: Write README once function is approved.