br-g / openf1

OpenF1 API - Real-time and historical Formula 1 data
Other
380 stars 18 forks source link

Driver API returning inconsistent data types for team_colour variable #57

Closed KevinCamacho closed 6 months ago

KevinCamacho commented 6 months ago

Was reviewing my web application, designed to show race results for all the races in the season. I was validating the recent fixes made to the Drivers API, where some data was not coming for certain drivers and certain sessions.

I observed some inconsistencies in the team_colour variable for both Aston Martin drivers (note, I've only checked race sessions, possible there are other issues with other teams in other sessions).

If we look at Bahrain: https://api.openf1.org/v1/drivers?session_key=9472&driver_number%3E13&driver_number%3C20 and Jeddah: https://api.openf1.org/v1/drivers?session_key=9480&driver_number%3E13&driver_number%3C20

we can see that team_colour is coming as a string.

If we look at Australia and Japan https://api.openf1.org/v1/drivers?session_key=9488&driver_number%3E13&driver_number%3C20 https://api.openf1.org/v1/drivers?session_key=9496&driver_number%3E13&driver_number%3C20

we can see that team_colour is coming as an integer. Conveniently, due to the way I setup my filter, Charles Leclerc's data comes in and we can see his team_colour is always a string.

br-g commented 6 months ago

Hello, Thanks for noticing that! This has been fixed