我收到的数据相当平坦,上面有homePhone,cellPhone和workPhone。目的地希望对数据进行规范化,以便获取:
{
...
"phones": [
{"type":"work", "number":"888-888-888"},
{"type":"cell", "number":"888-888-888"},
{"type":"home", "number":"888-888-888"},
]
...
}
如果字段之一为null或为空,则不应发送该元素。我如何配置HTTP发布操作的主体,以便仅在传入属性具有值的情况下才有选择地将对象添加到数组?
答案 0 :(得分:0)
答案 1 :(得分:0)