Skip to content
Snippets Groups Projects
Verified Commit c11a228f authored by Daniel Hornung's avatar Daniel Hornung
Browse files

WIP: Fixing validation of to_dict() result.

parent b303abef
No related branches found
No related tags found
No related merge requests found
Pipeline #59591 failed
...@@ -329,7 +329,12 @@ class XLSXConverter: ...@@ -329,7 +329,12 @@ class XLSXConverter:
for e in exceptions]) for e in exceptions])
raise jsonschema.ValidationError(mess) raise jsonschema.ValidationError(mess)
if validate: if validate:
jsonschema.validate(self._result, self._schema) for dtype, items in self._result.items():
sub_schema = self._schema["properties"].get(dtype)
if dtype is None:
raise KeyError(f"Type not found in schema's properties: {dtype}")
for item in items:
jsonschema.validate(item, sub_schema)
if self._errors: if self._errors:
raise RuntimeError("There were error while handling the XLSX file.") raise RuntimeError("There were error while handling the XLSX file.")
return self._result return self._result
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment