Skip to content

JSONArrayResourceType error decoder expects a JSONArray as input #54

@marius-serban

Description

@marius-serban

Imagine a case where you expect expect a JSON array in the body if the request is successful and a JSON dictionary body in case the server returns a 400 status code.

The error decoder signature now looks like this:

func error(from jsonArray: [Any]) -> Error?

it would be nice if it were something like:

func error(from json: Any, statusCode: Int) -> Error?

or maybe even more generic, providing the raw Data as a parameter.

This issue applies also to the other specialised resource types.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions