appropriate error message?
It's a default message by go if the input doesn't match the struct target
{
"error": "json: cannot unmarshal array into Go value of type struct { Title string
\"json:\\\"title\\\"\"; Year int32 \"json:\\\"year\\\"\"; Runtime int32 \"json:\\
\"runtime\\\"\"; Genres []string \"json:\\\"genres\\\"\" }"
again, I would just say: "your json input is invalid, please check documentation at https://xyz.docs/endpoint"
Обсуждают сегодня