You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The validators must be able to support Fieldmasks in order to make the validation context dependent.
Why do we need this?
The same proto message can have different fields relevant in different rpcs. This selection is made via fieldmasks. Hence, the validation of a field must be dependent on whether it is required by the fieldmask or not.
What is already there? What do you see now?
Validate() functions do not operate on fieldmasks.
What is missing? What do you want to see?
The generated validator would now be of the form Validate(paths []string). Only the paths defined in this fieldmask will be validated. The other fields will be ignored.
How do you propose to implement this?
Generate New methods
Support Extraction of fieldmasks to fields and propagation to sub-messages.
Support repeated messages.
Support Maps stubbing
Crazy testing
There are some indirect changes that are necessary for the above changes:
Improve error handling to easily compare errors for automated testing.
Fix improper existing error messages.
Additional
Update README and code examples.
What can you do yourself and what do you need help with?
A PR will be available shortly.
The text was updated successfully, but these errors were encountered:
Summary:
The validators must be able to support Fieldmasks in order to make the validation context dependent.
Why do we need this?
The same proto message can have different fields relevant in different rpcs. This selection is made via fieldmasks. Hence, the validation of a field must be dependent on whether it is required by the fieldmask or not.
What is already there? What do you see now?
Validate()
functions do not operate on fieldmasks.What is missing? What do you want to see?
The generated validator would now be of the form
Validate(paths []string)
. Only the paths defined in this fieldmask will be validated. The other fields will be ignored.How do you propose to implement this?
repeated
messages.Maps
stubbingThere are some indirect changes that are necessary for the above changes:
Additional
What can you do yourself and what do you need help with?
A PR will be available shortly.
The text was updated successfully, but these errors were encountered: