Skip to content

Root Array #53

@edon2005

Description

@edon2005

Hi guys,
Have a problem:
initial data:
[ { "field1": "Value1", "field2": "Value2 }, { "field1": "Value1", "field2": "Value2 }, .....
Mapping such json - don't have any problem using: Response.map(to: [Custom].self)
But if I have empty root array [ ] - we got "Failed to map data to JSON." But there is no Failing to map. It is just empty array. Is not better to return empty array instead of error? Or maybe I do something wrong and there is another way?
Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions