问题:如下
在传递一个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"}