azure-sdk-for-net
azure-sdk-for-net copied to clipboard
Genereate and implement Maps Search V2
This PR contains:
- Generated code for Maps Search from stable/2023-06-01/search.json
- Implementation of custom models
- Updated samples
- Updated tests
- Upgrade version to 2.0.0-beta.1
PR is blocked by: https://dev.azure.com/msazure/One/_git/Maps-Shared-Platform/pullrequest/9930761
Thank you for your contribution @jecmenicanikola! We will review the pull request and get back to you soon.
API change check
APIView has identified API level changes in this PR and created following API reviews.
Another important option we need to support is Accept-Language header (See API: https://learn.microsoft.com/en-us/rest/api/maps/search/get-geocoding?view=rest-maps-2024-04-01&tabs=HTTP#request-headers). In previous API, it's a query parameter, but now we need to set language from header. We need to support SearchLanguage (we should rename it to GeocodingLanguage), make it an geocoding option/reverse geocoding option, and set it to header by our own.
@dubiety As for Accept-Language, in SearchRestClient there is logic to set that header, and during creation of SearchRestClient _acceptLanguage can be set. I am not sure that I understand what you want.
@jecmenicanikola , MapsSearchClient.cs is where SearchRestClient() is called, if you check the place where SearchRestClient() is called, the acceptLanguage argument is always set to null or ignored.
After looking into the code, I figured out Accept-Language option cannot be set in each geocoding call, and user needs to decide it when MapsSearchClient is instentiated. In this case, we need to add a string SearchLanguage class member (don't rename it to GeocodingLanguage) in MapsSearchClientOptions.cs and set SearchLanguage in MapsSearchClient.cs when option is passed to SearchSearchClient() constructor, like L#67, L#100, and L#131. Does that make sense to you?
Hi @jsquire,
We've fixed all the comments. Can you take a look again? Much appreciated! :)
Hi @jsquire,
We've fixed all the comments. Can you take a look again? Much appreciated! :)
My blocker has been removed. You should be able to move forward to merge with your approval.