Fix GoingToCamp provider KeyError and broken site details endpoint#391
Open
aniketde wants to merge 1 commit intojuftin:mainfrom
Open
Fix GoingToCamp provider KeyError and broken site details endpoint#391aniketde wants to merge 1 commit intojuftin:mainfrom
aniketde wants to merge 1 commit intojuftin:mainfrom
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/api/mapsendpoint no longer provides per-facilitymapIdlookups, causing aKeyErrorat_process_facilities_responses. Now usesrootMapIdfrom/api/resourceLocationinstead./api/resource/detailsendpoint: This endpoint now returns 404 across all GoingToCamp domains. Added a graceful fallback so campsite availability searches still complete with basic site info.root_map_idfield to theResourceLocationmodel to capture the new data.Fixes #377
Verified providers after fix
Campsite availability search also verified end-to-end: Alta Lake State Park (Washington) returned 2 available campsites with working booking links.
Test plan
/api/resource/detailsreturns 404