SD2E/opil

Validate Parameter.required when loading from an opil file

tramyn opened this issue · 2 comments

When loading an opil file with a ProtocolInterface, opil==1.0b3.post2 does not validate that a required field must be present for each opil.Parameter. Since this is a required field that must appear in a Parameter object, it will be valuable to have opil validate that this field is set when loading opil from a file.

Hi @tramyn required Parameters are currently checked by the SHACL validator. Does this test case here cover the use case you are describing?
https://github.com/SD2E/opil/blob/master/test/test_opil.py#L46

This validation is not automatically checked when loading a file, but you can call doc.validate after doc.read to check it.

@bbartley the linked test case matches my description. I'll update IP to use doc.validate after performing doc.read. Thanks!