gin-gonic / gin

Gin is a HTTP web framework written in Go (Golang). It features a Martini-like API with much better performance -- up to 40 times faster. If you need smashing performance, get yourself some Gin.
https://gin-gonic.com/
MIT License
79.18k stars 8.03k forks source link

[typo error] form binding #3768

Open Cayincc opened 1 year ago

Cayincc commented 1 year ago
type VectorizationProductForm struct {
    Id      int    `json:"id" from:"id" binding:"required,gte=1"`
    FileUrl string `json:"file_url" from:"file_url" binding:"required"`
}

Using "form" not working, but "from" is correct.

VERSION:

go 1.21.0

require (
    github.com/gin-contrib/cors v1.4.0
    github.com/gin-gonic/gin v1.9.1
    github.com/go-ini/ini v1.67.0
    github.com/swaggo/files v1.0.1
    github.com/swaggo/gin-swagger v1.6.0
    github.com/webx-top/com v1.1.3
)

require (
    github.com/KyleBanks/depth v1.2.1 // indirect
    github.com/admpub/fsnotify v1.5.0 // indirect
    github.com/bytedance/sonic v1.10.2 // indirect
    github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect
    github.com/chenzhuoyu/iasm v0.9.1 // indirect
    github.com/francoispqt/gojay v1.2.13 // indirect
    github.com/gabriel-vasile/mimetype v1.4.3 // indirect
    github.com/gin-contrib/sse v0.1.0 // indirect
    github.com/go-openapi/jsonpointer v0.20.0 // indirect
    github.com/go-openapi/jsonreference v0.20.2 // indirect
    github.com/go-openapi/spec v0.20.9 // indirect
    github.com/go-openapi/swag v0.22.4 // indirect
    github.com/go-playground/locales v0.14.1 // indirect
    github.com/go-playground/universal-translator v0.18.1 // indirect
    github.com/go-playground/validator/v10 v10.15.5 // indirect
    github.com/goccy/go-json v0.10.2 // indirect
    github.com/google/go-cmp v0.5.9 // indirect
    github.com/hashicorp/go-version v1.6.0 // indirect
    github.com/josharian/intern v1.0.0 // indirect
    github.com/json-iterator/go v1.1.12 // indirect
    github.com/klauspost/cpuid/v2 v2.2.5 // indirect
    github.com/leodido/go-urn v1.2.4 // indirect
    github.com/mailru/easyjson v0.7.7 // indirect
    github.com/mattn/go-isatty v0.0.20 // indirect
    github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
    github.com/modern-go/reflect2 v1.0.2 // indirect
    github.com/pelletier/go-toml/v2 v2.1.0 // indirect
    github.com/rogpeppe/go-internal v1.9.0 // indirect
    github.com/swaggo/swag v1.16.2 // indirect
    github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
    github.com/ugorji/go/codec v1.2.11 // indirect
    golang.org/x/arch v0.5.0 // indirect
    golang.org/x/crypto v0.14.0 // indirect
    golang.org/x/net v0.17.0 // indirect
    golang.org/x/sys v0.13.0 // indirect
    golang.org/x/text v0.13.0 // indirect
    golang.org/x/tools v0.14.0 // indirect
    google.golang.org/protobuf v1.31.0 // indirect
    gopkg.in/yaml.v3 v3.0.1 // indirect
)
fnoopv commented 11 months ago

add your code and error message