SD2E / opil

The Open Protocol Interface Language (OPIL) is intended as a standard language for protocol interfaces
5 stars 1 forks source link

Validate Parameter.required when loading from an opil file #170

Open tramyn opened 3 years ago

tramyn commented 3 years ago

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.

bbartley commented 3 years ago

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.

tramyn commented 3 years ago

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