You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Places: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 408 column 36 path $.result.secondary_opening_hours #906
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 408 column 36 path $.result.secondary_opening_hours
Following these steps will guarantee the quickest resolution possible.
Thanks!
Reacted by Matthew Williams, Dean Gurvitz, Nevo24, Uri Peled, Tiago Fernandes, cannonrush, James Hudson, Aaron Sloup, Victor Alvarez, João Cana Verde and 6 more
This is a json response parsing issue of the google library and should be fixed ASAP! That something like this is open for over 2 years should be unacceptable.
I also ran into this issue when using PlacesApi.placeDetails(...). The JsonSyntaxException seems to be caused by the secondary_opening_hours field being returned as an array instead of an object in some responses.
My workaround was to explicitly only request the fields I needed, which excluded secondary_opening_hours entirely and helped reduce the size of the API response as well:
@MattWilliams89 do you have something else besides the placeId? Because its expired. Or anyone else got a store/company/place where this happens that I can test? I am working on a PR to fix this.
Activity
wangela commentedon Apr 12, 2023
If you would like to upvote the priority of this issue, please comment below or react with 👍 so we can see what is popular when we triage.
@MattWilliams89 Thank you for opening this issue. 🙏
Please check out these other resources that might help you get to a resolution in the meantime:
google-mapstagThis is an automated message, feel free to ignore.
deansg commentedon Apr 13, 2023
I have received the same issue when using Java 17, and sending a request for place with id ChIJhbDp64aLGGAR5ywd2IRem7Q
According to the official API documentation here, the secondary_opening_hours field is an Array, which seems to be the cause of the problem
tomag commentedon Apr 30, 2023
I bypassed this bug by excluding the secondary_opening_hours field -
asloup commentedon Aug 5, 2023
Here's the same thing in Kotlin if anybody needs it:
Osiris-Team commentedon Apr 10, 2025
This is a json response parsing issue of the google library and should be fixed ASAP! That something like this is open for over 2 years should be unacceptable.
tel05 commentedon Apr 14, 2025
I also ran into this issue when using
PlacesApi.placeDetails(...). TheJsonSyntaxExceptionseems to be caused by thesecondary_opening_hoursfield being returned as an array instead of an object in some responses.My workaround was to explicitly only request the fields I needed, which excluded
secondary_opening_hoursentirely and helped reduce the size of the API response as well:This approach avoids the field altogether and ensures you're not requesting more data than necessary.
Osiris-Team commentedon Apr 15, 2025
@MattWilliams89 do you have something else besides the placeId? Because its expired. Or anyone else got a store/company/place where this happens that I can test? I am working on a PR to fix this.
fix googlemaps#906 - secondary opening hours must be an array