同一对象实例,序列化后,出现 {"$ref":"$. 的问题

问题:如下

在传递一个json对象时,出现了下面的问题;

detailImageDtoList是明细图片信息,mainImageDtoList所有图片信息,包含了detailImageDtoList中的图片

由于,在初始化mainImageDtoList 和 detailImageDtoList使用了同一个实例,所以序列化时出现了下面的问题。

这个代码够坑,查了好久才查到,命名有问题mainImage....detailImage...无语了,

main 明明包含了detail,还非要做俩,浪费资源

 

{  "maker":"云南茶树王茶业有限公司","goodGb":0,"goodsIdList":"","prcNoTax":257.75,"prcTaxName":"课税","createTime
":1546565426000,"goodWd":1459468800000,"prchDur":20,"createUserId":"9091",
"isPreferential":"Y","snglPackYn":"N", "orgRgn":"中国云南勐海","name":"茶树王七大茶山普洱茶", 
"mainImageDtoList":[  
{"path":"","enable":1,"goodsId":100399,"width":0,"id":"474","sort":1,"type":2,"url":"/oss_uat/b656b/5453a/4940bb65836bfc4a2079a70277
35453a.jpg","height":0},
{"path":"","enable":1,"goodsId":100399,"width":284,"id":"11306","sort":2,"type":2,"url":"/oss_uat/e63e9/5dca8
/07bdde6330e9a846d83988835f45dca8.gif","height":95},
{"path":"","enable":1,"goodsId":100399,"width":351,"id":"11304","sort":1,"type":3,"url":"/oss_uat/20a87/6fdbd/9afce20a3b8
7964959089e4a6946fdbd.png","height":499}
],

"detailImageDtoList":[
{"$ref":"$.mainImageDtoList[2]"},{"$ref":"$.mainImageDtoList[3]"}] 


,"activityIconStartTimeStr":"","etrName":"张春婵","prcTaxRateName":"16%","taxCd":"20"}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值