Azure / Azure/azure-sdk-for-java

[BUG] MapsSearchClient.getReverseGeocoding() always returns null for MapsSearchAddressCountryRegion.getIso()

Aperta
#44,529 4 commenti 0 reazioni 1 assegnatario Rivendicata da @dubiety Vedi su GitHub
bug customer-reported Maps needs-team-attention
Lingua principale
Java
Stelle
2.6k
Fork
2.2k
Merge medio
2g 2h
PR unite (30g)
205

Descrizione

**Describe the bug**
When requesting an address via the method `getReverseGeocoding` of the `MapsSearchClient`, the `iso` value of the country region is always `null`.

The reason seems to be a wrong field matcher in the `MapsSearchAddressCountryRegion.fromJson()` method. The response field is named `"iso"` but the matcher checks for `"ISO"`.

**To Reproduce**
Steps to reproduce the behavior: (Kotlin)

```
val result = mapSearchClient.getReverseGeocoding(
GeoPosition(-122.138681, 47.630358),
listOf(ReverseGeocodingResultTypeEnum.ADDRESS, ReverseGeocodingResultTypeEnum.COUNTRY_REGION),
"Auto"
)

val iso = result.features.firstOrNull()?.properties?.address?.countryRegion?.iso
```

**Expected behavior**
I'd expect the value to be filled by the iso code.

**Screenshots**

Debugged `fromJson` mapping function of `MapsSearchAddressCountryRegion`:
![Image](https://github.com/user-attachments/assets/c5f0c1aa-a009-4e2a-899c-b70713ab0a4a)

Query result:
![Image](https://github.com/user-attachments/assets/053b74fa-cb12-45a0-a8ed-d0d610a312ad)

**Setup (please complete the following information):**
- OS: Ubuntu 22.04
- IDE: IntelliJ
- Library/Libraries: com.azure:azure-maps-search:2.0.0-beta.2
- Java version: 17
- App Server/Environment: Tomcat
- Frameworks: Spring Boot

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.