From 96ec29dad26b1115e22b685ea616729016c69a45 Mon Sep 17 00:00:00 2001 From: Nitzan P <9297302+nitzpo@users.noreply.github.com> Date: Mon, 17 Nov 2025 23:42:31 +0200 Subject: [PATCH] Fix critical bug: rooms filter not working due to missing alias MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Deal model's 'rooms' field was missing the 'assetRoomNum' alias, causing room data from the API to not be loaded into the model. This resulted in all room-based filters returning 0 results. Bug discovered when querying "חנקין 62 חולון" for 3-room apartments. Query returned 0 results despite multiple 3-room deals existing in the data. Root cause: Pydantic requires field aliases to map API field names (camelCase) to Python attributes (snake_case). The 'rooms' field had no alias. Fix: Added alias="assetRoomNum" to rooms field in Deal model. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- nadlan_mcp/govmap/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nadlan_mcp/govmap/models.py b/nadlan_mcp/govmap/models.py index 430bc1f..5632209 100644 --- a/nadlan_mcp/govmap/models.py +++ b/nadlan_mcp/govmap/models.py @@ -132,7 +132,7 @@ class Deal(BaseModel): ) # Additional details - rooms: Optional[float] = Field(None, description="Number of rooms") + rooms: Optional[float] = Field(None, alias="assetRoomNum", description="Number of rooms") # Priority and metadata (added by our system, not from API) priority: Optional[int] = Field(