Skip to content

[Detail Bug] PoiCategory apiValue casing mismatch breaks filtering and deserialization #52

@detail-app

Description

@detail-app

Detail Bug Report

https://app.detail.dev/org_befd6425-a158-4e24-9d4d-1e5c08769515/bugs/bug_ab225075-0ce2-4003-b57d-bb8f5c2958b3

Summary

  • Context: The PoiCategory enum defines the point-of-interest categories used by the Apple Maps Server API for filtering search results and identifying place types in responses.
  • Bug: All apiValue strings in the PoiCategory enum use PascalCase (e.g., "Airport", "Bakery") or UPPERCASE (e.g., "ATM") instead of the lowercase camelCase expected by the Apple Maps Server API (e.g., "airport", "bakery", "atm").
  • Actual vs. expected: The code currently uses capitalized strings for the API values, but the Apple Maps Server API expects lowercase camelCase strings for both request parameters (includePoiCategories, excludePoiCategories) and response fields (poiCategory).
  • Impact: This bug causes two major issues: (1) search result filtering fails because the API does not recognize the capitalized category names, and (2) the poiCategory field in search responses is always Optional.empty() because Jackson fails to match the lowercase strings from the API to the capitalized enum values.

Code with bug

    /** Airport. */
    AIRPORT("Airport"), // <-- BUG 🔴 Should be "airport"
    /** Airport gate. */
    AIRPORT_GATE("AirportGate"),
    /** Airport terminal. */
    AIRPORT_TERMINAL("AirportTerminal"),
    /** Amusement park. */
    AMUSEMENT_PARK("AmusementPark"),
    /** ATM. */
    ATM("ATM")

Failing test

A reproduction test shows Jackson cannot deserialize the API's lowercase value into the enum when apiValue is capitalized.

// From PoiCategoryReproductionTest.java output:
PoiCategoryReproductionTest > testDeserialization() STANDARD_OUT
    API Value: airport, Expected: Airport, Actual: null

PoiCategoryReproductionTest > testDeserialization() FAILED
    org.opentest4j.AssertionFailedError: Failed to deserialize airport ==> expected: <Airport> but was: <null>

Recommended fix

Update all apiValue strings in src/main/java/com/williamcallahan/applemaps/domain/model/PoiCategory.java to lowercase camelCase to match the Apple Maps Server API specification.

    AIRPORT("airport"), // <-- FIX 🟢
    AIRPORT_GATE("airportGate"),
    EV_CHARGER("evCharger")

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