mwitkow/go-proto-validators

Optional but if value exists apply this validation rule

neowulf opened this issue · 1 comments

Requesting to add the ability to add a validation rule to an optional field. I am unclear about the right syntax but a possible semantic would be like this:

// Optional. But if the value is present, the length of the value should be greater than 0
string fieldname = 1 [(validator.field) = {optional: true, length_gt: 0, length_lt: 257}];

Was this feature added? seems like the answer is NO?