-
Notifications
You must be signed in to change notification settings - Fork 224
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
Configurable valuer interface #155
Comments
oliy
added a commit
to oliy/ozzo-validation
that referenced
this issue
Sep 29, 2021
…sql.driver.Valuer transform. go-ozzo#155
Hi @oliy, I met the same problem as you. e.g. type MySice []MyStruct
func (s MySice) Value() (driver.Value, error) {
return json.Marshal(s)
}
type Foo struct {
MySice
}
// This will serialize `MySice` into JSON and get error on `validation.Length(1, 3)`.
validation.ValidateStruct(foo, validation.Field(&foo.MySice, validation.Length(1, 3))) Would you like to give us some advice? @qiangxue |
Thearas
added a commit
to Thearas/ozzo-validation
that referenced
this issue
Dec 19, 2021
Thearas
added a commit
to Thearas/ozzo-validation
that referenced
this issue
Dec 20, 2021
Thearas
added a commit
to Thearas/ozzo-validation
that referenced
this issue
Dec 20, 2021
Thearas
added a commit
to Thearas/ozzo-validation
that referenced
this issue
Dec 20, 2021
oliy
added a commit
to oliy/ozzo-validation
that referenced
this issue
Jan 20, 2022
…sql.driver.Valuer transform. go-ozzo#155
swithek
pushed a commit
to jellydator/validation
that referenced
this issue
Jul 31, 2022
…sql.driver.Valuer transform. go-ozzo#155
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In my application, I actually don't want sql.Valuer to be expanding my values, since I have a struct that expands to a JSON object in the DB. When I run validations, this means that it's validating against the JSON string and not the actual object. I'd like to be able to turn off this translation. Even better would be a way to pass in the interface or function that is able to convert specific validation objects.
The text was updated successfully, but these errors were encountered: