gothinkster / golang-gin-realworld-example-app

Exemplary real world application built with Golang + Gin
https://realworld.io
MIT License
2.52k stars 496 forks source link

Undefined validation function 'exists' on field 'Username' #32

Closed CaiqueCoelho closed 1 year ago

CaiqueCoelho commented 1 year ago

When I try to call a post a request to http://localhost:8080/api/users I get the error :

Undefined validation function 'exists' on field 'Username'

I'm running the project with go run hello.go

And my JSON body is:

{"user":{"email":"caiquedpfc+16@gmail.com", "password":"test123", "username":"caique_coelho_15"}}

Does anyone know how to fix that?

CaiqueCoelho commented 1 year ago

I was able to resolve my problem by doing a downgrade to gin-gonic/gin@v1.4.0 using:

go get github.com/gin-gonic/gin@v1.4.0
go build
./golang-gin-realworld-example-app