I am using unboxing (https://github.com/JohnSundell/Unbox.git) for Object mapping in my Project I have a problem with this, I am unable to parse the data when it is comes as a Array from service. For example if the data is in the below form
[
    {
        "name": "Spotify",
        "id":"101"
    },
    {
        "name": "Netflix",
        "id":"102"
    }
]
Getting an exception from the Unboxer, can we map Array objects through Object mapper? Please help me...
                        
Unbox maps your JSON to structures or classes, therefore you have to have a struct/class that conforms to
Unboxableprotocol. For example:Then you can use it like so (provided URL serves your JSON example):
As for raw dictionaries or arrays, IMO there's no point of using Unbox for that, just use
JSONSerialization.jsonObject(with:), like this:Note: In real world you'd prefer catching thrown exceptions (if any).