api-sports / public-roadmap

82 stars 7 forks source link

Inconsistencies with how substitutions are returned #170

Closed elietheocari closed 2 years ago

elietheocari commented 2 years ago

This is a duplicate for #121 which was closed without providing an answer, while the bug is still there.

When requesting the fixtures endpoint, providing a value for the id parameter, let's consider two games.

Game 710788 (Burnley - Man Utd, Feb 8th), here is what we can find in the events structure. Player out is McTominay (events[n].player). Player in is Lingard (events[n].assist).

{
    "time": {
        "elapsed": 80,
        "extra": null
    },
    "team": {
        "id": 33,
        "name": "Manchester United",
        "logo": "https://media.api-sports.io/football/teams/33.png"
    },
    "player": {
        "id": 903,
        "name": "S. McTominay"
    },
    "assist": {
        "id": 900,
        "name": "J. Lingard"
    },
    "type": "subst",
    "detail": "Substitution 2",
    "comments": null
},

Game 710801 (Man Utd - Southampton, Feb 12th), here is what we can find in the events structure: Player out is McTominay (events[n].assist). Player in is Elanga (events[n].player).

{
    "time": {
        "elapsed": 76,
        "extra": null
    },
    "team": {
        "id": 33,
        "name": "Manchester United",
        "logo": "https://media.api-sports.io/football/teams/33.png"
    },
    "player": {
        "id": 153430,
        "name": "A. Elanga"
    },
    "assist": {
        "id": 903,
        "name": "S. McTominay"
    },
    "type": "subst",
    "detail": "Substitution 1",
    "comments": null
},

So, depending on the game, players out are sometimes in the player structure, some other times in the assist structure, which makes no sense at all.

Can you please fix this? Thanks in advance.

elietheocari commented 2 years ago

Hello everyone,

Fixture 710801, yesterday afternoon after the game:

{
    "time": {
        "elapsed": 76,
        "extra": null
    },
    "team": {
        "id": 33,
        "name": "Manchester United",
        "logo": "https://media.api-sports.io/football/teams/33.png"
    },
    "player": {
        "id": 153430,
        "name": "A. Elanga"
    },
    "assist": {
        "id": 903,
        "name": "S. McTominay"
    },
    "type": "subst",
    "detail": "Substitution 1",
    "comments": null
},

Same fixture, this morning:

{
    "time": {
        "elapsed": 75,
        "extra": null
    },
    "team": {
        "id": 33,
        "name": "Manchester United",
        "logo": "https://media.api-sports.io/football/teams/33.png"
    },
    "player": {
        "id": 903,
        "name": "S. McTominay"
    },
    "assist": {
        "id": 153430,
        "name": "A. Elanga"
    },
    "type": "subst",
    "detail": "Substitution 1",
    "comments": null
},

It seems to happen with every game (at least Man Utd ones). Thank you for your help!