Closed jondavid-black closed 6 months ago
I made some progress on this, but it has kind of exploded. One thing just keeps leading to the next. It got to the point that I abandoned the branch and started working a new internal API to make some of this workable. Details are in #691.
Believe the majority, if not all, of this got incorporated within the 0.4.0 rebaseline effort as seen in PR #714 , so this task should be able to be closed once that PR has been merged.
Reference Issues
681
671
This is a blocker for #675
Summary
As an AaC developer, I want to simplify the modeling, creation, and usage of validators so that plugin development is simpler.
An expected advantage would be the elimination of duplicated validation execution and an increase in runtime performance.
AC:
context_validator
that applies to the global context of the model.schema_validator
that applies to specific structural model declarations.primitive_validator
that apples to specific value model declarations.gen-plugin
to simplify development of validators from a plugin/validator model.Basic Example
The context validator would be very similar to the existing validators but would not provide a unit under test in the execution api. The
root_keys
validator is probably a good example of a context validator and would require only minimal updates.The schema validator is really just the validator we currently use. The
required_fields
validator is a good example of this.The primitive validator is going to be similar to existing primitive validators. The validators under
primitive_type_check
are example of this.The validator definition will be changed to not use behavior explicitly, but will contain many of the same behavior fields. Each validator should be stand-alone, and not have a list of potential behavior defined in the model. While the idea of reuse was good here, it doesn't align as well as it could with how validators work in the AaC system.
What are the drawbacks/impacts of your feature request?
No drawbacks/impacts are currently known. There are no validator developers outside the AaC team, so nobody should be impacted. We will have to update the 3rd party plugin once this is completed.
Unresolved questions
There's been good discussion here, so I don't believe we have any unresolved questions at this time.