Skip to content

Fix GoingToCamp provider KeyError and broken site details endpoint#391

Open
aniketde wants to merge 1 commit intojuftin:mainfrom
aniketde:fix/goingtocamp-keyerror-campground-listing
Open

Fix GoingToCamp provider KeyError and broken site details endpoint#391
aniketde wants to merge 1 commit intojuftin:mainfrom
aniketde:fix/goingtocamp-keyerror-campground-listing

Conversation

@aniketde
Copy link

@aniketde aniketde commented Mar 7, 2026

Summary

  • Fix KeyError when listing campgrounds: The GoingToCamp /api/maps endpoint no longer provides per-facility mapId lookups, causing a KeyError at _process_facilities_responses. Now uses rootMapId from /api/resourceLocation instead.
  • Handle removed /api/resource/details endpoint: This endpoint now returns 404 across all GoingToCamp domains. Added a graceful fallback so campsite availability searches still complete with basic site info.
  • Added root_map_id field to the ResourceLocation model to capture the new data.

Fixes #377

Verified providers after fix

Provider Rec Area Campgrounds Found
Washington State Parks 3 79
Wisconsin State Parks 7 50
Parks Canada 14 78
Michigan State Parks 17 72
Nova Scotia Parks 13 20

Campsite availability search also verified end-to-end: Alta Lake State Park (Washington) returned 2 available campsites with working booking links.

Test plan

  • Verified campground listing works across 5 GoingToCamp providers (all previously crashing with KeyError)
  • Verified campsite availability search completes and returns results with booking URLs
  • Verified graceful fallback when /api/resource/details returns 404

The GoingToCamp API has changed its /api/maps endpoint to no longer
provide per-facility mapId lookups, causing a KeyError when listing
campgrounds. This fix:

- Uses rootMapId from /api/resourceLocation response instead of
  looking up mapId from /api/maps (which no longer has it)
- Adds root_map_id field to ResourceLocation model
- Gracefully handles the now-404 /api/resource/details endpoint
  by returning fallback site data so availability searches still work

Fixes juftin#377

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] GoingToCamp provider KeyError when listing campgrounds

1 participant