Unsupported field name 'id' error when using Google Places Search API
BytewaveMLP opened this issue · 4 comments
When attempting to perform a Places Search API lookup for a given location using the default fields specified by the gem, no results are returned, and an error is printed to the console due to the use of deprecated and now removed id
and reference
fields.
Expected behavior
The default fieldset specified by the gem should be valid.
Actual behavior
The following error is printed and no results are returned:
Google Places Search API error: invalid request (Error while parsing 'fields' parameter: Unsupported field name 'id'. ).
Steps to reproduce
- Make a
search
request withlookup: :google_places_search
without specifyingfield:
Environment info
- Geocoder version: 1.8.2
- Rails version: 7.0.5.1
- Database (if applicable): N/A
- Lookup (if applicable):
google_places_search
Thanks for this. I'm open to a pull request to fix it. Looks like an easy change, just two lines.
I can open a PR tomorrow, just wanted to confirm that was an acceptable solution as it would change the default result set without a suitable replacement.
Good to take that into consideration. But we have to change it if the default is an error. Let's just get rid of those two "legacy" fields, right?
Sure, sounds good.