-
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
Consider adding a new function to return reflection type #1357
Comments
I been thinking about doing that for a long time, the only issue is not knowing which reflection value field to return sometimes and how to represent nested validations. Interesting in hearing everyone's thoughts though. The above example is very straight forward and so seems easy but take the following sudo code example: struct C {
Value string `validate:"required,..."`
}
struct B {
Value string `validate:"required,..."`
}
struct A {
...
MapOrKeyToB map[C]*B `validate:"required,dive,keys,required,endkeys,required,otherstructvalidation"`
}
Unknowns are:
Happy to discuss further, I don't know how I would consolidate/reconcile all into working consistently across like field name using dot notation does eg. |
One idea that might help is to introduce a |
Package version eg. v9, v10:
v10
Issue, Question or Enhancement:
I encountered an issue when using the
eqfield
validator in theDTO
struct. Theeqfield
parameter points to a field, but in the case of a validation error, it returns a string instead of a reflection type or a separateparamField
. This makes it difficult to determine which field caused the error and to access its JSON tag.Code sample, to showcase or reproduce:
I'm using
en.RegisterDefaultTranslations
The text was updated successfully, but these errors were encountered: