Open
Description
Current Behavior
When encoding/decoding from data with slices of custom structs, they are ignored even thought the examples mention:
[...]
struct
[...]
a slice or a pointer to a slice of one of the above types
Output:
map[name:[Name]]
Expected Behavior
Output:
map[name:[Name], id:[1 2], amount:[1 2]
Steps To Reproduce
var encoder = schema.NewEncoder()
type Position struct {
ID int64 `schema:"id"`
Amount int64 `schema:"amount"`
}
type Document struct {
Name string `schema:"name"`
Positions []Position `schema:"position"`
}
func main() {
person := Document{"Name", []Position{{1, 1}, {2, 2}}}
form := url.Values{}
encoder.Encode(person, form)
fmt.Println(form)
}
Output:
map[name:[Name]]