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

GetPlaceDetail JSON deserialization error #4

Open
travisthedeveloper opened this issue Apr 21, 2018 · 0 comments
Open

GetPlaceDetail JSON deserialization error #4

travisthedeveloper opened this issue Apr 21, 2018 · 0 comments

Comments

@travisthedeveloper
Copy link

This is the error message I get:
Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'System.Collections.Generic.List`1[GoogleMapsAPI.NET.API.Places.Components.PlaceOpeningPeriodDayTime]' 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 'result.opening_hours.periods[0].close.day', line 79, position 25.

This is the code to reproduce it:
[code]
var client = new MapsAPIClient(mapApiKey);
var placeId = "ChIJtQ4Qnyt-j4ARL1uo6qaPYv8";
var detail = client.Places.GetPlaceDetails(placeId);
[/code]

I'm using Newtonsoft.Json v11.0,2 if it matters.

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

1 participant