Skip to content

[Detail Bug] AddressCategory.POSTAL_CODE uses "PostalCode" instead of "PostCode" (Apple Maps Server API) #56

@detail-app

Description

@detail-app

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 🟢

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions