-
Notifications
You must be signed in to change notification settings - Fork 57
[BREAKING CHANGE] Reusing Custom Validation Rules #51
Copy link
Copy link
Closed
Labels
Breaking ChangeDescribes a breaking change to the protovalidate APIDescribes a breaking change to the protovalidate APIFeatureNew feature or requestNew feature or request
Description
Feature description:
I don't know it is possible. But reusing validation rules would be nice.
Problem it solves or use case:
A validation rule may be suitable for multiple fields.
Currently, same custom cel expression duplicated to all fields. This makes harder to maintain custom validation rules.
Proposed implementation or solution:
I don't know if there is a way to extend the rules. But if we could extend the rules, we could apply the rule to the field as normal standard constraint.
For Example;
string xxx = 1 [(buf.validate.field) = {string.<custom_cel_id>: true}];
Contribution:
Examples or references:
Additional context:
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Breaking ChangeDescribes a breaking change to the protovalidate APIDescribes a breaking change to the protovalidate APIFeatureNew feature or requestNew feature or request