jolpica / jolpica-f1

Apache License 2.0
41 stars 1 forks source link

Standings response format of empty responses differs from Ergast #22

Closed theOehrly closed 5 months ago

theOehrly commented 5 months ago

Constructor Standings

If the response of the constructor standings endpoint is empty, Ergast returns a response with an empty "StandingsLists" array, but here, the "StandingsLists" array contains a single object where the "ConstructorStandings" array is empty instead.

The following diff highlights the difference.

FAIL: http://localhost:8000/api/f1/2023/constructorStandings/12.json?limit=1000 - http://api.jolpi.ca/ergast/f1/2023/constructorstandings/12.json?limit=1000
--- 
+++ 
@@ -1,7 +1,12 @@
 {
   "MRData": {
     "StandingsTable": {
-      "StandingsLists": [],
+      "StandingsLists": [
+        {
+          "ConstructorStandings": [],
+          "season": "2023"
+        }
+      ],
       "constructorStandings": "12",
       "season": "2023"
     },

Driver Standings

The same problem occurs.