feat(places): add Places API (New) support (v1)#252
Merged
Conversation
…ment)
Add the modern Places API (New) (places.googleapis.com/v1) alongside the
frozen legacy Places endpoints, with full parity across all five surfaces and
a comprehensive Place model. Follows the Routes API blueprint — no engine
changes needed, since the HTTP engine already issues a POST whenever a request
supplies a body and a GET otherwise.
Surfaces:
- Text Search POST v1/places:searchText -> SearchTextResponse
- Nearby Search POST v1/places:searchNearby -> SearchNearbyResponse
- Place Details GET v1/places/{placeId} -> Place
- Autocomplete POST v1/places:autocomplete -> AutocompleteResponse
- Photo media GET v1/{photoName}/media -> PlacePhotoResponse
API key and field mask ride in the query string (key, $fields); the photo
endpoint uses skipHttpRedirect=true so Google returns JSON ({ name, photoUri })
on the existing string-deserialize path rather than raw image bytes.
Facade accessors (static GoogleMaps + GoogleMapsClient/IGoogleMapsClient):
PlacesSearchText, PlacesSearchNearby, PlaceDetailsNew, PlacesAutocompleteNew,
PlacePhoto.
Mark the legacy Places request types and facade properties [Obsolete] (warning)
steering users to the new namespace; backward-compat plumbing is wrapped in
pragma CS0618 so the build stays clean.
Add offline unit tests (URI/method/field-mask/body/validation/enum round-trip/
Place deserialization) and live integration tests. README updated; CHANGELOG
left to release.sh per project convention.
🔬 TestGlancebuild · ✅ 242 passed — 100.0%████████████████ 100.0% vs
Updated 2026-05-30T18:24:32.947Z |
Owner
Author
Code reviewFound 2 issues:
🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the modern Places API (New) (
places.googleapis.com/v1) alongside the frozen legacy Places endpoints, with full parity across all five surfaces and a comprehensivePlacemodel. Follows the Routes API blueprint — no engine changes required, becauseMapsAPIGenericEnginealready issues aPOSTwhenever a request supplies a body (GetRequestBody()returns non-nullHttpContent) and aGETotherwise.Surfaces
v1/places:searchTextPlacesSearchTextv1/places:searchNearbyPlacesSearchNearbyv1/places/{placeId}PlaceDetailsNewv1/places:autocompletePlacesAutocompleteNewv1/{photoName}/mediaPlacePhotokey,$fields), as Routes does.skipHttpRedirect=trueso Google returns JSON{ name, photoUri }on the existing string-deserialize path (no binary handling).Public surface
GoogleMapsand onGoogleMapsClient/IGoogleMapsClient:PlacesSearchText,PlacesSearchNearby,PlaceDetailsNew,PlacesAutocompleteNew,PlacePhoto.GoogleMapsApi/Entities/PlacesNew/(Common/Request/Response), including a comprehensivePlacemodel (address components, opening hours, photos, reviews, payment/parking/accessibility/fuel/EV-charge options, etc.).Deprecation
Legacy Places request types and their facade properties are marked
[Obsolete](warning, not error) pointing to the new namespace. Our own backward-compat plumbing is wrapped in#pragma warning disable CS0618so the build stays clean (TreatWarningsAsErrorsis false).Tests & docs
PlacesNewUnitTests): URI host/path, POST-vs-GET,$fieldspresence/absence, key, request-body field names & null-omission, required-arg validation,skipHttpRedirect, enum[EnumMember]round-trip, andPlacedeserialization from a captured JSON sample. 20/20 pass; Routes unit tests still 11/11.IntegrationTests/PlacesNewTests) added (not run in CI without a key).CHANGELOG.mdintentionally untouched (auto-generated byrelease.sh).Notes
JsonSerializerContextexists in the repo yet; if the AOT PR (Develop/aot il2026 #247) merges first, the newPlacesNew.Responsetypes will need registration there.