Format error messages of validate nicer
matentzn opened this issue · 1 comments
matentzn commented
Right now (dosdp-0.1.8.dev1) its a bit chatty and hard to read:
matentzn@mbp:~/ws/bio-attribute-ontology/src/ontology (odk-migration) $ dosdp validate -i ../patterns/dosdp-patterns/entity_attribute.yaml
INFO:numexpr.utils:Note: NumExpr detected 16 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 8.
INFO:numexpr.utils:NumExpr defaulting to 8 threads.
INFO:root:Checking /Users/matentzn/ws/bio-attribute-ontology/src/patterns/dosdp-patterns/entity_attribute.yaml
/Users/matentzn/opt/anaconda3/lib/python3.8/site-packages/dosdp/validator.py:30: UserWarning:deque(['additionalProperties']) => Additional properties are not allowed ('axioms' was unexpected) => []
/Users/matentzn/opt/anaconda3/lib/python3.8/site-packages/dosdp/validator.py:30: UserWarning:deque(['properties', 'annotations', 'items', 'oneOf']) => {'property': 'oio:hasExactSynonym', 'text': '%s of %s', 'vars': ['attribute', 'entity']} is not valid under any of the given schemas => [<ValidationError: "Additional properties are not allowed ('property' was unexpected)">, <ValidationError: "{'property': 'oio:hasExactSynonym', 'text': '%s of %s', 'vars': ['attribute', 'entity']} is not valid under any of the given schemas">, <ValidationError: "Additional properties are not allowed ('vars', 'text', 'property' were unexpected)">, <ValidationError: "'annotationProperty' is a required property">, <ValidationError: "'value' is a required property">, <ValidationError: "Additional properties are not allowed ('vars', 'text', 'property' were unexpected)">, <ValidationError: "'annotationProperty' is a required property">, <ValidationError: "'var' is a required property">]
INFO:root:Validation completed with issues to be fixed.