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
When Validate Json By Schema throws a jsonschema.ValidationError it is hard to know where or what exactly the Problem is.
example: Json does not match the schema: {'type': 'object', 'enum': ['SUCCESS', 'ERROR', 'UNDEFINED', 'BUSINESS_ERROR']}
there is no Info what exactly the problem is.
I would propose to change the error message from except jsonschema.ValidationError as e: fail(f"Json does not match the schema: {e.schema}")
to except jsonschema.ValidationError as e: fail(f"{e.message}, Schema path: {' > '.join(e.schema_path)}")
So the error in the example would instead read: 'SUCCESS' is not one of ['ERROR', 'UNDEFINED', 'BUSINESS_ERROR'], Schema path: properties > state > enum
which makes more sense to me. What do you think?
The text was updated successfully, but these errors were encountered:
When Validate Json By Schema throws a jsonschema.ValidationError it is hard to know where or what exactly the Problem is.
example:
Json does not match the schema: {'type': 'object', 'enum': ['SUCCESS', 'ERROR', 'UNDEFINED', 'BUSINESS_ERROR']}
there is no Info what exactly the problem is.
I would propose to change the error message from
except jsonschema.ValidationError as e: fail(f"Json does not match the schema: {e.schema}")
to
except jsonschema.ValidationError as e: fail(f"{e.message}, Schema path: {' > '.join(e.schema_path)}")
So the error in the example would instead read:
'SUCCESS' is not one of ['ERROR', 'UNDEFINED', 'BUSINESS_ERROR'], Schema path: properties > state > enum
which makes more sense to me. What do you think?
The text was updated successfully, but these errors were encountered: