core
core copied to clipboard
constants/heroes returns inconsistent json format
I spent the last half hour trying to figure out why my json parser wasn't able to convert the response based on the types i provided for it. Turns out the json returned in the browser is different from the one returned when requesting it through my application.
https://api.opendota.com/api/constants/heroes in browser returns a single object with key : value pair of hero objects while requesting it from code results in https://pastie.io/dvztnc.json an array of hero objects
Hmm, I think we have to fix the docs, or the code that returns these. But either way, you can also request them from github
It seems to leave out a lot of data as well. I have no way to recreate this however. It returns fine using wget, curl etc, its just when requesting it through my application (written in C#) that it seems to get a different response
Edit: Note that this is just the json response gotten by the httpclient, nothing is parsed yet.
If it's correct with wget/curl the issue is something going on with your C# application or http lib
If it's correct with wget/curl the issue is something going on with your C# application or http lib
Yeah thats what i initially thought too, but if i request it directly from github i get the correct response so i'm really confused