Catalog-API: /api/location/{id} geometry field is double-serialized -- returns JSON string instead of object
- Dominant language
- Python
- Stars
- 1.1k
- Forks
- 200
- Avg merge
- 4h 56m
- Merged PRs (30d)
- 5
Description
## Description
The `geometry` field in the `/api/location/{location_id}` response is returned as a JSON-encoded string rather than a parsed GeoJSON object.
## Steps to Reproduce
GET https://catalog.data.gov/api/location/6
## Expected Behavior
`geometry` field returns a GeoJSON object directly.
## Actual Behavior
`geometry` is a JSON string containing escaped GeoJSON -- developers must call `JSON.parse()` on the value to use it, which is unexpected and undocumented.
## Example
```json
{
"id": "6",
"geometry": "{\"type\":\"MultiPolygon\",\"coordinates\":[...]}"
}
Notes
Confirmed April 27, 2026 on location ID 6 (Colorado). Needs testing on additional location IDs to confirm consistent behavior.
Contributor guide
Assessment
This issue has not been assessed yet.