Open
Description
I am trying to parse the following
type NewEmail struct {
From mail.Address `form:"from"`
// ...
}
with
// In handler
if err := c.Bind(dtoPtr); err != nil { // dtoPtr is *NewEmail
errResponse = c.JSON(http.StatusBadRequest, Res(ResData{
Msg: "Review your input",
D: err, // here's the error
}))
return
}
Getting following error unknown type
{
"d": {
"message": "unknown type"
},
"msg": "Review your input",
"status": false
}
I've checked that it works if I make NewEmail
structs From
field to string
from mail.Address
. It is beneficial for me if I can parse to mail.Address
based on my use case. How this can be done?
Metadata
Metadata
Assignees
Labels
No labels