Open jpower432 opened 3 months ago
@degenaro Please add additional information as necessary
The issue here is that the datamodel-codegen process assisted generation of Python classes seemingly does not produce constraints that insure, in the cited issue #1606 for example, that when an array is specified it must have at least one element. Resolving this issue will likely involve understanding how to detect such situations in the OSCAL model and producing the annotation in the generated code accordingly. This may be a datamodel-codegen problem. Even so, a work-around in the trestle domain to the extent reasonably achievable may be warranted.
Describe the bug
The csv_to_oscal_cd task produces an component definition that is not well-formed when a profile is specified for a rule with no mapped controls. This issue is meant to capture the root cause of this issue which is that the classes represents the OSCAL schema do not enforce this.
To Reproduce
Steps to reproduce the behavior:
See #1606 for reproduction steps
Expected behavior
Failure relating to the invalid OSCAL Model Object
Screenshots / Logs.
Related to #1606
Environment