{"action":"opened","issue":{"url":"https://api.github.com/repos/alexreisner/geocoder/issues/1352","repository_url":"https://api.github.com/repos/alexreisner/geocoder","labels_url":"https://api.github.com/repos/alexreisner/geocoder/issues/1352/labels{/name}","comments_url":"https://api.github.com/repos/alexreisner/geocoder/issues/1352/comments","events_url":"https://api.github.com/repos/alexreisner/geocoder/issues/1352/events","html_url":"https://github.com/alexreisner/geocoder/issues/1352","id":371214730,"node_id":"MDU6SXNzdWUzNzEyMTQ3MzA=","number":1352,"title":"Config w/ multiple API providers for forward lookup results in Nominatin lookup","user":{"login":"posiczko","id":386464,"node_id":"MDQ6VXNlcjM4NjQ2NA==","avatar_url":"https://avatars1.githubusercontent.com/u/386464?v=4","gravatar_id":"","url":"https://api.github.com/users/posiczko","html_url":"https://github.com/posiczko","followers_url":"https://api.github.com/users/posiczko/followers","following_url":"https://api.github.com/users/posiczko/following{/other_user}","gists_url":"https://api.github.com/users/posiczko/gists{/gist_id}","starred_url":"https://api.github.com/users/posiczko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/posiczko/subscriptions","organizations_url":"https://api.github.com/users/posiczko/orgs","repos_url":"https://api.github.com/users/posiczko/repos","events_url":"https://api.github.com/users/posiczko/events{/privacy}","received_events_url":"https://api.github.com/users/posiczko/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-17T18:40:34Z","updated_at":"2018-10-17T18:40:34Z","closed_at":null,"author_association":"NONE","body":"Multiple API providers were defined in the initializer per README:\r\n\r\n```ruby\r\nGeocoder.configure(\r\n  timeout:      3,\r\n  cache:        Redis.new,\r\n  cache_prefix: \"geocoder\",\r\n\r\n  location_iq:  {\r\n      api_key: Rails.application.credentials[:geocoding][:location_iq_key]\r\n  },\r\n    \r\n  opencagedata: {\r\n      api_key: Rails.application.credentials[:geocoding][:opencage_data_key]\r\n  },\r\n    \r\n  mapbox:       {\r\n      api_key: Rails.application.credentials[:geocoding][:mapbox_token]\r\n  }\r\n)\r\n```\r\n\r\n### Expected behavior\r\n\r\nFor non-cached lookups, expected result is the for the first available API which does not time out/error out to provide result.\r\n\r\n### Actual behavior\r\n\r\nResult was provided by Nominatin:\r\n\r\n```ruby\r\n[1] pry(main)> results = Geocoder.search (\"1600 Pennsylvania Ave NW, Washington, DC\")\r\n=> [#<Geocoder::Result::Nominatim:0x00007fc942d7baf0\r\n  @cache_hit=false,\r\n  @data=\r\n   {\"place_id\"=>\"238019587\",\r\n    \"licence\"=>\"Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright\",\r\n    \"osm_type\"=>\"way\",\r\n    \"osm_id\"=>\"238241022\",\r\n    \"boundingbox\"=>[\"38.8974898\", \"38.897911\", \"-77.0368542\", \"-77.0362526\"],\r\n    \"lat\"=>\"38.8976998\",\r\n    \"lon\"=>\"-77.0365534886228\",\r\n    \"display_name\"=>\"White House, 1600, Pennsylvania Avenue Northwest, Golden Triangle, Washington, District of Columbia, 20500, USA\",\r\n    \"class\"=>\"historic\",\r\n    \"type\"=>\"building\",\r\n    \"importance\"=>1.0276757387296138,\r\n ...\r\n```\r\n\r\nAdding `lookup: :mapbox` to the configure does result in lookup by Mapbox.\r\n\r\nMaybe I'm misunderstanding something? Should configuration with multiple sources result in first available API to respond? Many thanks for your work!\r\n\r\n### Environment info\r\n\r\n* Geocoder version: 1.5.0 \r\n* Rails version: 5.2.1\r\n* Database (if applicable): \r\n* Lookup (if applicable): \r\n"}}
{"actor":{"display_login":"posiczko"}}