我试图在json4s结构中添加一个额外的字段,但文档只描述了removeField和transformField。缺少类似addField的东西。 所以,我有的json输入是:
{
"layers": [
{
"name": "geometry",
"layerProperties": [
{
"name": "Schema-Layer",
"value": "schema"
},
{
"name": "Schema-Proto-Bundle",
"value": "geometry"
},
{
"name": "Compression",
"value": "true"
},
{
"name": "Content-Type",
"value": "application/x-protobuf"
}
]
},
{
"name": "schema",
"layerProperties": [
{
"name": "Content-Type",
"value": "application/zip"
}
]
},
{
"name": "state",
"layerProperties": [
{
"name": "Compression",
"value": "true"
}
]
},
{
"name": "history",
"layerProperties": [
{
"name": "Content-Type",
"value": "application/json"
}
]
}
]
}
我需要实现这个目标:
{
"layers": [
{
"name": "geometry",
"dataUrl": "s3://somebucket/somepath",
"layerProperties": [
{
"name": "Schema-Layer",
"value": "schema"
},
{
"name": "Schema-Proto-Bundle",
"value": "geometry"
},
{
"name": "Compression",
"value": "true"
},
{
"name": "Content-Type",
"value": "application/x-protobuf"
}
]
},
{
"name": "schema",
"dataUrl": "s3://somebucket/somepath",
"layerProperties": [
{
"name": "Content-Type",
"value": "application/zip"
}
]
},
{
"name": "state",
"dataUrl": "s3://somebucket/somepath",
"layerProperties": [
{
"name": "Compression",
"value": "true"
}
]
},
{
"name": "history",
"dataUrl": "s3://somebucket/somepath",
"layerProperties": [
{
"name": "Content-Type",
"value": "application/json"
}
]
}
]
}
那么,每一层都需要有一个dataUrl fieldAny ideas?