asaskevich / govalidator

[Go] Package of validators and sanitizers for strings, numerics, slices and structs
MIT License
5.97k stars 554 forks source link

Add filters to transform data after validation #489

Open SharkFourSix opened 1 year ago

SharkFourSix commented 1 year ago

Feature Request

Q A
New Feature yes
RFC yes/no
BC Break yes/no

Summary

It would be nice to have support for filters alongside validators. Filters will allow transformation of the input values. For instance, instead of manually having to trim strings of space, a trim filter can be added to do that. Another case is when you'd want to convert a string's case and or trim off excess characters.

Can this be done?