Closed milosmns closed 4 years ago
I tried this with Gin-Gonic
type AddUserRequest struct { // some other properties DateOfBirth null.Time `json:"user_birthday" time_format:"2006-01-02"` }
When I send
{ // some other stuff "user_birthday": "2000-04-05" }
I still get the (infamous?) parsing time \"\"2000-04-05\"\" as \"\"2006-01-02T15:04:05Z07:00\"\": cannot parse \"\"\" as \"T\"" error.
parsing time \"\"2000-04-05\"\" as \"\"2006-01-02T15:04:05Z07:00\"\": cannot parse \"\"\" as \"T\""
Is there a workaround for this issue? I don't want to send a string and parse manually.
Thanks!
Sorry but this library uses this standard library's time.Time JSON marshaler which requires that it be in RFC 3339 format. If you'd like to add support for other formats feel free to fork.
I tried this with Gin-Gonic
When I send
I still get the (infamous?)
parsing time \"\"2000-04-05\"\" as \"\"2006-01-02T15:04:05Z07:00\"\": cannot parse \"\"\" as \"T\""
error.Is there a workaround for this issue? I don't want to send a string and parse manually.
Thanks!