mirror of
https://github.com/gin-gonic/gin.git
synced 2026-05-04 18:28:11 +08:00
When a struct field implements json.Unmarshaler, form binding passes the raw form value directly to json.Unmarshal. Since form values are plain strings (e.g. "2020/09/23 13:20:49"), not valid JSON, the unmarshal fails. Fix this by retrying with the value wrapped in JSON quotes when the initial unmarshal fails. Fixes #2510