googlemaps / googlemaps/google-maps-services-js

Autocomplete prediction type fields should be optional

Open
#1,106 1 comment 2 reactions 0 assignees View on GitHub
priority: p2 type: bug
Dominant language
TypeScript
Stars
3.1k
Forks
654
Avg merge
3m
Merged PRs (30d)
4

Description

Hi,

The autocomplete response type currently lists `types` & `place_id` as required properties:
https://github.com/googlemaps/google-maps-services-js/blob/e6cd0e77f1f0ecbfe08062e763bbf4e5235c03dc/src/places/autocomplete.ts#L148

However according to the docs, these properties are optional:
https://developers.google.com/maps/documentation/places/web-service/autocomplete#PlacesAutocompleteResponse

This caught us off guard recently as we had queries that would not return `types`, such as `Rua ch 13`. However I'm not sure under what circumstances a `place_id` would not be returned. However I believe the types should accurately reflect the response returned.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.