You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
revert: keep get_games() as list[dict] — Statistics Center spec too incomplete for typed models
The generated Games model only documents 3 fields (match_id, home_team, away_team);
real API returns date, game_day, running etc. which land in additional_properties
without .get() support, breaking all existing callers.
The statistics_center_client is still vendored (Login/LoginSuccess models are
available) but response parsing stays as plain dicts until the spec is complete.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: AGENTS.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ Python wrapper for the Kinexon Handball API. Provides a user-friendly abstractio
10
10
-`api.py`: Two-step authentication and `httpx` client initialization.
11
11
-`handball.py`: Main entry point (`HandballAPI`). Convenience methods for common API operations.
12
12
-`fetchers.py`: Static data loading (e.g., team IDs from `config/teams.yaml`).
13
-
-`statistics_center.py`: Separate wrapper for the Statistics Center REST + WebSocket API. Uses `Games` and `LoginSuccess` from the generated `statistics_center_client`.
13
+
-`statistics_center.py`: Separate wrapper for the Statistics Center REST + WebSocket API. All REST methods return plain `list[dict]` — the Statistics Center OpenAPI spec is incomplete (missing fields), so generated models are vendored but not used for response parsing.
14
14
-**Generated Clients (`src/_vendor/`)**: Two auto-generated OpenAPI clients via `openapi-python-client`.
15
15
-`kinexon_client/` — generated from `openapi/sports_app.json` (main Kinexon Cloud REST API).
16
16
-`statistics_center_client/` — generated from `openapi/statistics_center.json` (Statistics Center REST API).
Copy file name to clipboardExpand all lines: README.md
+5-6Lines changed: 5 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -129,11 +129,10 @@ You can add new teams by modifying `config/teams.yaml`. Somehow there is no API
129
129
130
130
### Statistics Center (REST + Websocket)
131
131
132
-
The package also provides a dedicated wrapper for the Statistics Center API. REST responses use typed models from the generated `statistics_center_client`:
132
+
The package also provides a dedicated wrapper for the Statistics Center API:
133
133
134
134
```python
135
135
from kinexon_handball_api import StatisticsCenterAPI
Returns player statistics for a match from `/stats/{match_id}`. Returns `list[dict[str, Any]]` (the Statistics Center spec has no field-level schema for stats responses).
218
+
Returns player statistics for a match from `/stats/{match_id}`. Returns `list[dict[str, Any]]`.
- JWT authentication via `/auth/login`. The login response is parsed into a `LoginSuccess` model from `statistics_center_client.models`.
107
-
-`get_games()` and `get_games_via_websocket()` return `list[Games]` (typed attrs model from `statistics_center_client.models`).
108
-
-`get_stats()` and `get_events()` return `list[dict[str, Any]]` — the Statistics Center spec has no field-level schema for these responses.
107
+
-`get_games()`, `get_games_via_websocket()`, `get_stats()`, and `get_events()` all return `list[dict[str, Any]]` — the Statistics Center spec only documents 3 fields for games (`match_id`, `home_team`, `away_team`) while the real API returns many more; a generated model would bury the extra fields in `additional_properties` without `.get()` support, so plain dicts are used.
109
108
-`python-socketio` for WebSocket subscriptions (lazy-imported so the dependency is optional at import time).
0 commit comments