Skip to content

Runtime Error BindJson #1361

Closed
Closed
@zwhitchcox

Description

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?

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions