Đang Thực Hiện

build a java function

I want a java function, where i will provide source_json and mapping_json , and it should apply mapping json on source json and provide me output json

below are the examples/cases

Case 1 :

source json will be

{

"a":"val_a",

"b":

{

"b1":"val_b1",

"b2":"val_b2"

},

"c":

{

"c1":"val_c1",

"c2":

{

"c21":"val_c21",

"c22":"val_c22"

}

}

}

mapping json will be

{

"oa" :"a" ,

"ob" : "[login to view URL]",

"oc" : "[login to view URL]",

"oc1": "[login to view URL]"

}

output should be

{

"oa":"val_a",

"ob":"val_b1",

"oc":"val_c1",

"oc1" : "val_c21"

}

case 2 :

source json will be:

[

{

"a": "val_a0",

"b": {

"b1": "val_b01",

"b2": "val_b02"

},

"c": {

"c1": "val_c01",

"c2": {

"c21": "val_c021",

"c22": "val_c022"

}

}

},

{

"a": "val_a1",

"b": {

"b1": "val_b11",

"b2": "val_b12"

},

"c": {

"c1": "val_c11",

"c2": {

"c21": "val_c121",

"c22": "val_c122"

}

}

}

]

mapping json will be

{

"oa" : "a",

"ob" : "[login to view URL]",

"oc" : "[login to view URL]",

"oc1 : "[login to view URL]""

}

output should be

[

{

"oa":"val_a0",

"ob":"val_b01",

"oc":"val_c01",

"oc1" : "val_c021"

}, {

"oa":"val_a1",

"ob":"val_b11",

"oc":"val_c11",

"oc1" : "val_c121"

}

]

case 3 :

source json will be

[

{

"a": "val_a0",

"b": {

"b1": "val_b01",

"b2": "val_b02"

},

"c": {

"c1": "val_c01",

"c2": [

{

"c21": "val_c021_0",

"c22": "val_c022_0"

},

{

"c21": "val_c021_1",

"c22": "val_c022_1"

}

]

}

},

{

"a": "val_a1",

"b": {

"b1": "val_b11",

"b2": "val_b12"

},

"c": {

"c1": "val_c11",

"c2": [

{

"c21": "val_c121_0",

"c22": "val_c122_0"

},

{

"c21": "val_c121_1",

"c22": "val_c122_1"

}

]

}

}

]

mapping json will be

{

"[login to view URL]" : "a",

"[login to view URL]" : "[login to view URL]",

"[login to view URL]" : "[login to view URL]",

"[login to view URL] : "[login to view URL]""

}

output should be

{"o" :[

{

"oa": "val_a0",

"ob": "val_b01",

"oc": "val_c01",

"oc1": [

{

"c21": "val_c021_0"

},

{

"c21": "val_c021_1"

}

]

},

{

"oa": "val_a1",

"ob": "val_b11",

"oc": "val_c11",

"oc1": [

{

"c21": "val_c121_0"

},

{

"c21": "val_c121_1"

}

]

}

]

}

case 4 :

source json will be

{

"Response": {

"Status": {

"HttpCode": 200

},

"Services": [

{

"service": [

{

"servername": "mycomp1",

"usage": "18.5%",

"process": "disk"

},

{

"servername": "mycomp2",

"usage": "80.7%",

"process": "disk"

}

]

}

]

}

}

mapping json will be

{

"[login to view URL]" : "[login to view URL]",

"[login to view URL]" : "[login to view URL]",

"[login to view URL]" : "[login to view URL]"

}

output should be

{

"responseBody" : {

"data" :[

{

"name": "mycomp1",

"used": "18.5%",

"proc": "disk"

},

{

"name": "mycomp2",

"used": "80.7%",

"proc": "disk"

}

]

}

}

Kĩ năng: Java, Kiến trúc phần mềm, JavaScript, XML, JSON

Về Bên Thuê:
( 2 nhận xét ) Pune, India

ID dự án: #32698741

Được trao cho:

davidlee2022

A Java Expert is Here. No Problem! I have seen your project details carefully. I will do it right now. I can finish in only 1 hour.

₹625 INR trong 1 ngày
(1 Nhận xét)
0.4