Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSONArrayResourceType error decoder expects a JSONArray as input #54

Open
marius-serban opened this issue Jun 9, 2017 · 1 comment
Open

Comments

@marius-serban
Copy link

marius-serban commented Jun 9, 2017

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.

@KaneCheshire
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants