Enable validation in table_json_conversion.convert.to_dict for use in XLSX-converter
Summary
Reenables failing validation test. Changes some test data and adds preprocessing to the jsonschema validation.
Addresses #138 (closed) / https://gitlab.indiscale.com/caosdb/customers/dimr/management/-/issues/268
Focus
- Are the data_schemas an acceptable solution? Were the original schemas automatically generated? Does this necessitate any changes to other code?
- Allowing nullable properties can also be done in a json schema. The current solution using filtering is more lenient, but in my opinion it might be desirable to at some point switch to using oneof(null, validType) everywhere applicable, to adhere more closely to the standard.
- I did not find a way to validate the dates properly. A custom TypeChecker does not fit this use case, as we could accept
datetime
s as string everywhere, but not only when the format contains 'date'. Using a custom FormatChecker also does not work, as thedatetime
intype:string format:datetime
fields already fails on the typecheck. This left filtering as the most convenient solution.
Test Environment
Manual Testing.
Check List for the Authoe
-
All automated tests pass -
Reference related issues -
Up-to-date CHANGELOG.md or not necessary -
Up-to-date JSON schema or not necessary -
Appropriate user and developer documentation (or not necessary) -
Annotations in code (Gitlab comments)
Check List for the Reviewer
-
I understand the intent of this MR -
All automated tests pass -
Up-to-date CHANGELOG.md (or not necessary) -
Appropriate user and developer documentation (or not necessary) -
The test environment setup works and the intended behavior is reproducible in the test environment -
In-code documentation and comments are up-to-date. -
Check: Are there specifications? Are they satisfied?
Edited by Daniel Hornung
Merge request reports
Activity
Please register or sign in to reply