Я пытаюсь десериализовать этот ответ JSON с помощью конвертера JSON в C#. Раньше у меня никогда не было проблем, но с этим ответом результат преобразования довольно странный.
В любом случае, это ответ:
{
"get": "standings",
"parameters": {
"league": "520",
"season": "2020"
},
"errors": [],
"results": 1,
"response": [
{
"league": {
"id": 520,
"name": "Acreano",
"country": "Brazil",
"logo": "https://media.api-sports.io/football/leagues/520.png",
"flag": "https://media.api-sports.io/flags/br.svg",
"season": 2020,
"standings": [
[
{
"rank": 1,
"team": {
"id": 1228,
"name": "Galvez",
"logo": "https://media.api-sports.io/football/teams/1228.png"
},
"points": 0,
"goalsDiff": 0,
"group": "Acreano: 2nd Phase",
"form": null,
"status": "same",
"description": "Next Round",
"all": {
"played": 0,
"win": 0,
"draw": 0,
"lose": 0,
"goals": {
"for": 0,
"against": 0
}
},
"home": {
"played": 0,
"win": 0,
"draw": 0,
"lose": 0,
"goals": {
"for": 0,
"against": 0
}
},
"away": {
"played": 0,
"win": 0,
"draw": 0,
"lose": 0,
"goals": {
"for": 0,
"against": 0
}
},
"update": "2020-04-24T00:00:00+00:00"
},
{
"rank": 2,
"team": {
"id": 10478,
"name": "Humaitá",
"logo": "https://media.api-sports.io/football/teams/10478.png"
},
"points": 0,
"goalsDiff": 0,
"group": "Acreano: 2nd Phase",
"form": null,
"status": "same",
"description": "Next Round",
"all": {
"played": 0,
"win": 0,
"draw": 0,
"lose": 0,
"goals": {
"for": 0,
"against": 0
}
},
"home": {
"played": 0,
"win": 0,
"draw": 0,
"lose": 0,
"goals": {
"for": 0,
"against": 0
}
},
"away": {
"played": 0,
"win": 0,
"draw": 0,
"lose": 0,
"goals": {
"for": 0,
"against": 0
}
},
"update": "2020-04-24T00:00:00+00:00"
},
{
"rank": 3,
"team": {
"id": 10854,
"name": "Náuas",
"logo": "https://media.api-sports.io/football/teams/10854.png"
},
"points": 0,
"goalsDiff": 0,
"group": "Acreano: 2nd Phase",
"form": null,
"status": "same",
"description": null,
"all": {
"played": 0,
"win": 0,
"draw": 0,
"lose": 0,
"goals": {
"for": 0,
"against": 0
}
},
"home": {
"played": 0,
"win": 0,
"draw": 0,
"lose": 0,
"goals": {
"for": 0,
"against": 0
}
},
"away": {
"played": 0,
"win": 0,
"draw": 0,
"lose": 0,
"goals": {
"for": 0,
"against": 0
}
},
"update": "2020-04-24T00:00:00+00:00"
},
{
"rank": 4,
"team": {
"id": 6370,
"name": "Vasco da Gama AC",
"logo": "https://media.api-sports.io/football/teams/6370.png"
},
"points": 0,
"goalsDiff": 0,
"group": "Acreano: 2nd Phase",
"form": null,
"status": "same",
"description": null,
"all": {
"played": 0,
"win": 0,
"draw": 0,
"lose": 0,
"goals": {
"for": 0,
"against": 0
}
},
"home": {
"played": 0,
"win": 0,
"draw": 0,
"lose": 0,
"goals": {
"for": 0,
"against": 0
}
},
"away": {
"played": 0,
"win": 0,
"draw": 0,
"lose": 0,
"goals": {
"for": 0,
"against": 0
}
},
"update": "2020-04-24T00:00:00+00:00"
}
],
[
{
"rank": 1,
"team": {
"id": 1228,
"name": "Galvez",
"logo": "https://media.api-sports.io/football/teams/1228.png"
},
"points": 9,
"goalsDiff": 12,
"group": "Acreano: 1st Phase",
"form": "WWW",
"status": "same",
"description": "Next Round",
"all": {
"played": 3,
"win": 3,
"draw": 0,
"lose": 0,
"goals": {
"for": 14,
"against": 2
}
},
"home": {
"played": 1,
"win": 1,
"draw": 0,
"lose": 0,
"goals": {
"for": 2,
"against": 1
}
},
"away": {
"played": 2,
"win": 2,
"draw": 0,
"lose": 0,
"goals": {
"for": 12,
"against": 1
}
},
"update": "2020-04-24T00:00:00+00:00"
},
{
"rank": 2,
"team": {
"id": 10478,
"name": "Humaitá",
"logo": "https://media.api-sports.io/football/teams/10478.png"
},
"points": 6,
"goalsDiff": 0,
"group": "Acreano: 1st Phase",
"form": "WWL",
"status": "up",
"description": "Next Round",
"all": {
"played": 3,
"win": 2,
"draw": 0,
"lose": 1,
"goals": {
"for": 5,
"against": 5
}
},
"home": {
"played": 2,
"win": 1,
"draw": 0,
"lose": 1,
"goals": {
"for": 1,
"against": 4
}
},
"away": {
"played": 1,
"win": 1,
"draw": 0,
"lose": 0,
"goals": {
"for": 4,
"against": 1
}
},
"update": "2020-04-24T00:00:00+00:00"
},
{
"rank": 3,
"team": {
"id": 10854,
"name": "Náuas",
"logo": "https://media.api-sports.io/football/teams/10854.png"
},
"points": 3,
"goalsDiff": 3,
"group": "Acreano: 1st Phase",
"form": "LWL",
"status": "down",
"description": null,
"all": {
"played": 3,
"win": 1,
"draw": 0,
"lose": 2,
"goals": {
"for": 6,
"against": 3
}
},
"home": {
"played": 1,
"win": 1,
"draw": 0,
"lose": 0,
"goals": {
"for": 5,
"against": 0
}
},
"away": {
"played": 2,
"win": 0,
"draw": 0,
"lose": 2,
"goals": {
"for": 1,
"against": 3
}
},
"update": "2020-04-24T00:00:00+00:00"
},
{
"rank": 4,
"team": {
"id": 6370,
"name": "Vasco da Gama AC",
"logo": "https://media.api-sports.io/football/teams/6370.png"
},
"points": 0,
"goalsDiff": -15,
"group": "Acreano: 1st Phase",
"form": "LLL",
"status": "up",
"description": null,
"all": {
"played": 3,
"win": 0,
"draw": 0,
"lose": 3,
"goals": {
"for": 2,
"against": 17
}
},
"home": {
"played": 2,
"win": 0,
"draw": 0,
"lose": 2,
"goals": {
"for": 2,
"against": 12
}
},
"away": {
"played": 1,
"win": 0,
"draw": 0,
"lose": 1,
"goals": {
"for": 0,
"against": 5
}
},
"update": "2020-04-24T00:00:00+00:00"
},
{
"rank": 5,
"team": {
"id": 10853,
"name": "Independência",
"logo": "https://media.api-sports.io/football/teams/10853.png"
},
"points": 0,
"goalsDiff": 0,
"group": "Acreano: 1st Phase",
"form": null,
"status": "down",
"description": null,
"all": {
"played": 0,
"win": 0,
"draw": 0,
"lose": 0,
"goals": {
"for": 0,
"against": 0
}
},
"home": {
"played": 0,
"win": 0,
"draw": 0,
"lose": 0,
"goals": {
"for": 0,
"against": 0
}
},
"away": {
"played": 0,
"win": 0,
"draw": 0,
"lose": 0,
"goals": {
"for": 0,
"against": 0
}
},
"update": "2020-04-24T00:00:00+00:00"
}
]
]
}
}
]
}
И это результат .
public class Parameters
{
public string league { get; set; }
public string season { get; set; }
}
public class League
{
public int id { get; set; }
public string name { get; set; }
public string country { get; set; }
public string logo { get; set; }
public string flag { get; set; }
public int season { get; set; }
public IList<IList<>> standings { get; set; }
}
public class Response
{
public League league { get; set; }
}
public class Example
{
public string get { get; set; }
public Parameters parameters { get; set; }
public IList<object> errors { get; set; }
public int results { get; set; }
public IList<Response> response { get; set; }
}
Как видите, там странный publi c IList<IList<>> standings { get; set; }
. Я думаю, что это может зависеть от двойных квадратных скобок на постоянном теге, но я не так много работал с объектами Json.