tristanhimmelman / ObjectMapper

Simple JSON Object mapping written in Swift
MIT License
9.14k stars 1.03k forks source link

merge array objects #1053

Open yeziahehe opened 5 years ago

yeziahehe commented 5 years ago

Your JSON dictionary:

{
  "count": 2,
  "userOrderId": "12346r",
  "userName": "Jack",
  "card_info_list": [{
                "id": 20180637,
                "card_no": "23123123123123",
                "cost": "998.00",
            }, {
                "id": 20180636,
                "card_no": "1231231231231231",
                "cost": "998.00",
            }]
}

I want to merge this to

{
   [{
         "userOrderId": "12346r",
         "userName": "Jack",
    "id": 20180637,
    "card_no": "23123123123123",
    "cost": "998.00",
    }, {
         "userOrderId": "12346r",
         "userName": "Jack",
    "id": 20180636,
    "card_no": "1231231231231231",
    "cost": "998.00",
   }]
}