alexreisner / geocoder

Complete Ruby geocoding solution.
http://www.rubygeocoder.com
MIT License
6.35k stars 1.19k forks source link

Unsupported field name 'id' error when using Google Places Search API #1627

Closed BytewaveMLP closed 1 year ago

BytewaveMLP commented 1 year ago

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

  1. Make a search request with lookup: :google_places_search without specifying field:

Environment info

alexreisner commented 1 year ago

Thanks for this. I'm open to a pull request to fix it. Looks like an easy change, just two lines.

BytewaveMLP commented 1 year ago

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.

alexreisner commented 1 year ago

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?

BytewaveMLP commented 1 year ago

Sure, sounds good.