-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can I use case insensitive values in oneof validator #840
Comments
The field to be compared with the |
@vijsourabh as @filikos stated you could normalize the data if that's an option; here's a lib to help out with that https://github.com/go-playground/mold If not then a custom validator is also an option. |
This is a rather obtuse solution "downcase the value before validating" the point of the project is to add magic to model validation right? Adding another meta tag that will handle casing would be rather helpful. There are more applications to model validations that serving up 400s to a client, and using the same model across a platform is of benefit. I could accept "we are taking pull requests!" as a better answer than "downcase the value", it's essentially a non-answer. |
|
Just another idea Register your new validation
Validation logic for oneof_insensitive case
|
The case is I need to validate case insensitive oneof values in the field of JSON struct and not able to find anything. Can anyone suggest me anything to achieve the same?
The text was updated successfully, but these errors were encountered: