Detail Bug Report
https://app.detail.dev/org_befd6425-a158-4e24-9d4d-1e5c08769515/bugs/bug_5aa064d3-0e3c-4b96-89c9-692764d8858d
Summary
- Context:
AddressCategory is an enum used to filter search and autocomplete results by geographical boundaries (e.g., in includeAddressCategories and excludeAddressCategories parameters).
- Bug: The
apiValue for POSTAL_CODE is set to "PostalCode", but the Apple Maps Server API expects "PostCode".
- Actual vs. expected:
AddressCategory.POSTAL_CODE.apiValue() returns "PostalCode", while the Apple Maps Server API documentation specifies "PostCode" as the valid value for this category.
- Impact: Requests that attempt to include or exclude postal codes using this enum will fail to filter correctly, as the Apple Maps Server API will likely ignore the unrecognized
"PostalCode" value or return an error.
Code with bug
/**
* Postal code address component.
*/
POSTAL_CODE("PostalCode"); // <-- BUG 🔴 Should be "PostCode" to match Apple Maps Server API
Documentation
The Apple Maps Server API (search and autocomplete) lists valid values for includeAddressCategories and excludeAddressCategories as: AdministrativeArea, Country, Locality, PostCode, SubAdministrativeArea, and SubLocality. Our enum returns PostalCode, which is not recognized by the API.
Recommended fix
Update the apiValue for POSTAL_CODE to "PostCode".
/**
* Postal code address component.
*/
POSTAL_CODE("PostCode"); // <-- FIX 🟢
Detail Bug Report
https://app.detail.dev/org_befd6425-a158-4e24-9d4d-1e5c08769515/bugs/bug_5aa064d3-0e3c-4b96-89c9-692764d8858d
Summary
AddressCategoryis an enum used to filter search and autocomplete results by geographical boundaries (e.g., inincludeAddressCategoriesandexcludeAddressCategoriesparameters).apiValueforPOSTAL_CODEis set to"PostalCode", but the Apple Maps Server API expects"PostCode".AddressCategory.POSTAL_CODE.apiValue()returns"PostalCode", while the Apple Maps Server API documentation specifies"PostCode"as the valid value for this category."PostalCode"value or return an error.Code with bug
Documentation
The Apple Maps Server API (search and autocomplete) lists valid values for
includeAddressCategoriesandexcludeAddressCategoriesas:AdministrativeArea,Country,Locality,PostCode,SubAdministrativeArea, andSubLocality. Our enum returnsPostalCode, which is not recognized by the API.Recommended fix
Update the
apiValueforPOSTAL_CODEto"PostCode".