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 plugin should generate a func (*T) ValidateFields(...string) error method for each message.
Required by TheThingsNetwork/lorawan-stack#51
What is already there? What do you see now?
Only SetFields
What is missing? What do you want to see?
func (*T) ValidateFields(...string) error
How do you propose implementing this?
Follow the same structure as SetFields, instead of copying fields(terminal paths) - validate it according to the annotations.
If no fields are specified to ValidateFields (i.e. it's called as ValidateFields()), all fields are validated.
This lets ValidateFields have the same recursive structure as SetFields
What can you do yourself and what do you need help with?
I will add basic Validate method implementation and extend goType. @KrishnaIyer will then take over and add actual validator tags and their implementation as needed
The text was updated successfully, but these errors were encountered:
Summary:
The plugin should generate a
func (*T) ValidateFields(...string) error
method for each message.Required by TheThingsNetwork/lorawan-stack#51
What is already there? What do you see now?
Only
SetFields
What is missing? What do you want to see?
func (*T) ValidateFields(...string) error
How do you propose implementing this?
Follow the same structure as
SetFields
, instead of copying fields(terminal paths) - validate it according to the annotations.If no fields are specified to
ValidateFields
(i.e. it's called asValidateFields()
), all fields are validated.This lets
ValidateFields
have the same recursive structure asSetFields
The validation tags in protos could look the same as https://github.com/lyft/protoc-gen-validate
In fact, we could reuse the tag definitions they already have.
What can you do yourself and what do you need help with?
I will add basic
Validate
method implementation and extendgoType
.@KrishnaIyer will then take over and add actual validator tags and their implementation as needed
The text was updated successfully, but these errors were encountered: