Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 15 additions & 9 deletions camply/providers/going_to_camp/going_to_camp_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,21 @@
from typing import Any, Dict, List, Optional, Tuple, Union

from fake_useragent import UserAgent
from pydantic import ValidationError

from camply.containers import AvailableResource, CampgroundFacility, RecreationArea
from camply.containers.base_container import GoingToCampEquipment
from camply.containers.gtc_api_responses import ResourceLocation
from camply.providers.base_provider import BaseProvider, ProviderSearchError
from camply.providers.going_to_camp.rec_areas import RECREATION_AREAS
from camply.utils import make_list
from camply.utils.logging_utils import log_sorted_response
The fix is not in the provided file snippet but in the data model `RecDotGovCampsiteResponse` (likely in `camply/containers/gtc_api_responses.py`). The original model likely has:

```python
class RecDotGovCampsiteResponse(BaseModel):
campsites: Dict[str, Any]
```

It should be changed to:

```python
class RecDotGovCampsiteResponse(BaseModel):
campsites: Optional[Dict[str, Any]] = None
```

Or, if the response might be a list: `Optional[Any]`.

logger = logging.getLogger(__name__)

Expand Down