Validator composition for DMA validators #4812
rafaelmag110
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
My proposal is the following. In the Achieving this composition is not hard too. The class |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Data Management API controllers use JsonLD validators to verify if the incoming request payload adheres to certain rules. Extensions of these validators might be necessary if someone has additional verification requirements.
In case the new requirements should be composed on top of the verification rules existing in the current validator, the new validator extension has to include the existing rules too, leading to unnecessary code duplication.
Not only that, but to effectively override the existing validator, the extension providing the new validator has to register it in a different boot phase than
initiate
. This is not an ideal setup.My point with this discussion is to jointly design a solution that would address these issues. The solution should also allow new extensions that intend to provide additional verification steps to an existing validator to do so without having to duplicate code, and do the registration in a non ideal phase.
Beta Was this translation helpful? Give feedback.
All reactions