Skip to content
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

Runtime Error BindJson #1361

Closed
zwhitchcox opened this issue May 20, 2018 · 2 comments
Closed

Runtime Error BindJson #1361

zwhitchcox opened this issue May 20, 2018 · 2 comments

Comments

@zwhitchcox
Copy link

zwhitchcox commented May 20, 2018

I'm using Golang 1.10 with Gin (I'm not sure the version, but I'm using just go get github.com/gin-gonic/gin, and I'm getting a runtime error that there is Undefined validation function on field Username.

This is my code

type User struct {
	Username string `json:"username" binding:"required,min=4,max=30,alphanumunicode"`
	Email    string `json:"email" binding:"required,email"`
	Password string `json:"password" binding:"required"`
}

And it is failing on alphanumunicode, as defined in the validation documentation.

It has failed on several other documented validation functions as well. Does gin limit to a subset of these validation functions?

@zwhitchcox
Copy link
Author

Ok, just saw in the docs, gin uses v.8 which doesn't have the newer validation functions. Is this on purpose? Can we go ahead and upgrade?

@thinkerou
Copy link
Member

#1015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants