0

We are writing a lot of validation rules using protovalidate. Some of rules are custom rules writen with protovalidate's cel expressions.

Are there any way to reuse field options with import ?

For example,

Normally we are using like below;

message AMessageName {
    string xxx = 1 [(buf.validate.field) = {
        cel: {
            id: "uniqueruleid",
            message: "validation fail message",
            expression: "an expression to check validity"
        }
    }];
}

But we want to do like below;

message AMessageName {
    string xxx = 1 [(buf.validate.field) = IMPORTED_RULE_VARIABLE];
}

Thanks.

Rasit aydin
  • 419
  • 2
  • 6
  • 16

0 Answers0