Closed adrien-berchet closed 1 year ago
Note that this PR adds the jsonschema
dependency. If you prefer I can make it optional.
Cool, thanks!
Ok, I pushed a new commit to make it optional. Now a warning is raised is the user tries to use the new schema
parameter while jsonschema
is not installed.
With pleasure :)
Description
Add an optional parameter to
DictParameter
andListParameter
so the loaded value can be validated against a JSON schema.Motivation and Context
Adding a simple validation step reduces the amount of code in the
run
method of the tasks. Also, the arguments are checked at the beginning of the workflow so it fails faster, which is always better than failing during the workflow.Have you tested this? If so, how?
I added simple tests.