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

Deserialization Problem #3

Closed
dradovic opened this issue Jan 7, 2021 · 2 comments · Fixed by #4
Closed

Deserialization Problem #3

dradovic opened this issue Jan 7, 2021 · 2 comments · Fixed by #4

Comments

@dradovic
Copy link

dradovic commented Jan 7, 2021

When I call:
RestCountry.Code("AD");

I get:

Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'System.Collections.Generic.List`1[DotNetRestCountries.Country]' because the type requires a JSON array (e.g. [1,2,3]) to deserialize correctly.
To fix this error either change the JSON to a JSON array (e.g. [1,2,3]) or change the deserialized type so that it is a normal .NET type (e.g. not a primitive type like integer, not a collection type like an array or List) that can be deserialized from a JSON object. JsonObjectAttribute can also be added to the type to force it to deserialize from a JSON object.
Path 'name', line 1, position 8.

@elylv
Copy link

elylv commented Apr 1, 2021

I am also getting this error.

@99darshan
Copy link
Owner

@dradovic @elylv Thank you for notifying about the issue. This should now be resolved with the updated version 1.0.4

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

Successfully merging a pull request may close this issue.

3 participants