We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
function path:
fillSliceFromString fillSliceValue
https://github.com/zeromicro/go-zero/blob/master/core/mapping/unmarshaler.go#L266
api Define
type GoodsInfo { Sku int64 `json:"sku,optional"` } type GetReq { GoodsList []*PromotionGoodsInfo `json:"goods_list"` }
request Body
{ "goods_list": "[{\"sku\":1003001442820970},{\"sku\":1003001442626969},{\"sku\":1003001442310851},{\"sku\":1003001445182314},{\"sku\":100300104903791},{\"sku\":1003001442626966},{\"sku\":1003001441414899},{\"sku\":1003001445184038},{\"sku\":1003001442658793},{\"sku\":1003001443446765}]\\", }
return panic
ERRO[2024-12-12T10:57:22+08:00] panic: reflect: Key of non-map type types.GoodsInfo
The text was updated successfully, but these errors were encountered:
The value of goods_list is a string, not an array.
goods_list
As you defined, the json should be looked as below:
{ "goods_list": [{"sku":1003001442820970},{"sku":1003001442626969}] }
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
function path:
https://github.com/zeromicro/go-zero/blob/master/core/mapping/unmarshaler.go#L266
api Define
request Body
return panic
The text was updated successfully, but these errors were encountered: