Closed rjanjyam closed 5 months ago
Hi, @rjanjyam! Sorry for the delay in response. I'm having trouble reproducing what you're seeing, but perhaps I'm not quite understanding.
Using a similar message as yours:
All the following test cases pass:
If what you're looking for instead is to have protovalidate use a FieldMask to decide which fields to perform validation on generally, that feature does not exist. If you'd like, feel free to open a feature request issue over on the protovalidate repo for further discussion. There's a somewhat adjacent issue that covers skipping validation on certain fields.
Here is my message
reason I was trying to perform this check at message level is to validate a nested field of
ParentObj
only when it is present in field mask. i.e, perform validation when it is specified in field mask. I was trying to use nested ternary operation to acheive it but in vain. After some tests, realized that validation for field mask paths is not working at message level.Even with or without
obj.code
in field mask, I see the error message for this validation error thatcode should be present
.Environment
Possible Solution
Additional Context