Add injury_type and injury_expected_return attributes to the player API, not just the squad API
Currently it seems that injury_type and injury_expected_return data is only available when querying https://sports.bzzoiro.com/api/v2/teams/:id/squad and inspecting the player data there.
I feel it would make sense to expose that data through the player API as well, e.g. https://sports.bzzoiro.com/api/v2/players/:id
The context here is that for my app, I would like to query players directly to find out their injury status. As it stands, I would have to make an extra call for each player ID to the relevant squad API as well to determine their injury type and expected return date.
Resolution: injury_type + injury_expected_return added to serialize_player in public/v2_players.py (detail + list) and to PlayerDetailV2Schema. Same Player row every caller already selects, so no extra queries.
Comments
2
Bzzoiro · Admin
Aug 22, 2026 09:24
Done — both fields are on the player endpoint now.
GET /api/v2/players/{id}/ returns injury_type and injury_expected_return next to
availability, with exactly the same values the squad endpoint serves. They are on
the list endpoint too (GET /api/v2/players/), so you can page through players and
read injury status without touching /teams/{id}/squad at all.
Shape is unchanged from the squad payload: injury_type is a string, empty when the
player is available or no reason is published; injury_expected_return is a date
(YYYY-MM-DD) or null.
Example:
"availability": "injured",
"injury_type": "Knee Injury",
"injury_expected_return": "2026-09-20"
You were right that it made no sense to only have it in one place — both fields
already live on the player record, so serving them here costs nothing. It is live.
Bzzoiro
Aug 22, 2026 21:07
Awesome. Rapid turnaround, as always. Big thanks to you and Claude. :D
Log in to comment.