We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have a upload operation with more info. I use Should bind but not working.
// RegisterForm ... type RegisterForm struct { FullName string `form:"full_name" binding:"required"` Email string `form:"email" binding:"required"` Image *multipart.FileHeader `form:"image" binding:"required"` Password string `form:"password" binding:"required"` }
and binding here.
tmpForm := RegisterForm{} if err := ctx.ShouldBind(&tmpForm); err == nil { // .... } else { fmt.Println(err.Error()) }
Output:
Key: 'RegisterForm.Image' Error:Field validation for 'Image' failed on the 'required' tag
Request (Postman):
The text was updated successfully, but these errors were encountered:
issue ref: #1263 and pr ref: #1264
Sorry, something went wrong.
@ghost #1264 merged!
No branches or pull requests
I have a upload operation with more info. I use Should bind but not working.
and binding here.
Output:
Request (Postman):
![adsiz](https://user-images.githubusercontent.com/10995965/46904091-ae30c880-cee7-11e8-88f8-51444b5d272a.png)
The text was updated successfully, but these errors were encountered: