How can I set validation and default value in proto3?

749 views Asked by At

I'm trying to add default value to an optional field alongside with validation, but could not find any infos in the docs for multiple conditions in a proto field. This is the example:

optional string date = 1 [(validate.rules).string = { pattern: "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(Z|[+,-][0-9]{2}:[0-9]{2})"}];

After this I'd like to add a [default = "0001-01-01T00:00:00Z"].
How can I perform this?

0

There are 0 answers