我使用的是spring boot,我使用的是组合键。我想隐藏JSON对象的类型,我尝试了像@jsonIgnore
,@jsonIgnoreType
这样的注解,但是什么都不起作用。我有这个:
[ {
"consumoId" : {
"inc_acc_id" : "1069931929",
"inc_clu_cellular_number" : "2954316800",
"inc_description" : "Minutes"
},
"inc_frt_id" : null,
"inc_unit" : "Min.",
"inc_amount" : 0.0,
"inc_quantity" : 22.68
}]
我希望是这样:
[ {"inc_acc_id" : "1069931929",
"inc_clu_cellular_number" : "2954316800",
"inc_description" : "Minutes" ,
"inc_frt_id" : null,
"inc_unit" : "Min.",
"inc_amount" : 0.0,
"inc_quantity" : 22.68
}]
发布于 2018-06-07 04:54:38
看起来您想要内联consumoId
父对象下的属性?
@JsonIgnore
会完全跳过它,但是@JsonUnwrapped
会解开(省略)包含的对象。
https://stackoverflow.com/questions/50727905
复制相似问题