pythonjsonvalidationjsonschema

python json shema return all validation errors


I'm trying to validate json using python validictory, but when I get a validation error the validation ends and missing field name is reported, but if there is more than one field missing I only get a message about the first one. I need to know about all the fields that are missing. Is there an function which will return all missing fields?

This script only needs to validate a json document, so answers using other libraries, languages are welcome.


Solution

  • When you call .validate() set fail_fast property to False. That will force validictory to return all errors instead of only first one.