Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid JSON in the API #47

Open
juantrias opened this issue Jul 28, 2020 · 5 comments
Open

Invalid JSON in the API #47

juantrias opened this issue Jul 28, 2020 · 5 comments

Comments

@juantrias
Copy link

http://liveresultat.orientering.se/api.php?method=getcompetitions is now serving an invalid JSON because of a tab character inside " BEL_Ve Sprint Rocourt" competition. Tab characters and other special characters should be escaped on JSON when used inside strings https://www.freeformatter.com/json-escape.html.

I suppose that using json_encode to build the JSON as suggested in #43 should solve the problem. Otherwise you would have to manually escape this special chars before building the JSON.

live-results-getcompetitions-invalid-json

@eVe9n
Copy link

eVe9n commented Oct 1, 2021

I have the same issue with another competition.

@petlof
Copy link
Owner

petlof commented Oct 1, 2021 via email

@eVe9n
Copy link

eVe9n commented Oct 4, 2021

Sorry I didn't save the eventid I remember the name started with MTBO. Right now it doesn't return any error.

@eVe9n
Copy link

eVe9n commented May 7, 2022

I have the same issue with another competition: "id":22247, "name":" Mistrovství ČR ve sprintu"

Also, It's difficult to me if the JSON return a extra double quotes. For example in this competition: 2022-05-07 ДП 20-21 Средна дистанция / купа "Христо Ботев" БФО, Вариант5
Competition: "id":22509, "name":"ДП 20-21 Средна дистанция / купа ""Христо Ботев"""

@jsh-de
Copy link

jsh-de commented Dec 20, 2023

Just found out the API to retrieve the events was delivering invalid JSON due to some events having TAB-characters (ASCII 9) in their name:
20411;DM, sprint, Västergötland[TAB];2021-09-11 00:00:00
21615;Barbate SUN-O Cup - Night+Classic[TAB];2022-02-12 00:00:00
28408;2[TAB]Купа knsb;2022-12-02 00:00:00

I cleaned up those events manually and so the JSON seems to be clean... for now. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants