iris
iris copied to clipboard
ReadForm error with nested struct array
Request:
# post form
Items[0].Value=1&Items[1].Value=1
Server:
type S1 struct {
Items []S2
}
type S2 struct {
Value string
}
...
obj := &S1{}
err := ctx.ReadForm(obj) //while trying to read formam: not supported type for field "Value" in path "Items[1].Value"
...
work fine with github.com/go-playground/form
@WingGao ctx.ReadForm and formam works with nested fields, just use the .(dot).
An example can be found at its official docs: https://github.com/monoculum/formam#in-form-html