Invalid JSON at 31: Encountered an unknown key type
Closed this issue · 5 comments
yuechaor commented
Description
JSON format mismatch
How to Reproduce
- after finishing one round when reporting diffs to the server
- See error
Expected Behavior
Diffs should be reported to the server, and receive a success message
Screenshots
If applicable, add screenshots to help explain your problem.
System Information
- OS: Windows 10
- OS Version: Education 10
- Language Version: [Python 3.7, Node 10.18.1]
- Package Manager Version: [Conda 4.6.1, NPM 6.14.1]
- Browser (if applicable): Google Chrome]
- Browser Version (if applicable): [81.0.4044.138]
Additional Context
Error may be caused by JSON format mismatch caused by the ReportDataModels and CycleDataModels.
yuechaor commented
I used the suggested commit, followed this instruction:
git checkout 0e93aa645a63a02f45ae72b4ff3106c6402dbadf
mustansarsaeed commented
Hi @yuechaor, for some reasons ReportResponseSerializer
has issues in parsing. You need to manually parse the response and return as follows:
return if (!response.getObject("data").getPrimitive("status").content.isNullOrEmpty())
json.parse(
ReportResponseData.ReportSuccess.serializer(),
response.getObject("data").toString()
)
else
json.parse(ReportResponseData.ReportError.serializer(), data.toString())
yuechaor commented
Hi @yuechaor, for some reasons
ReportResponseSerializer
has issues in parsing. You need to manually parse the response and return as follows:return if (!response.getObject("data").getPrimitive("status").content.isNullOrEmpty()) json.parse( ReportResponseData.ReportSuccess.serializer(), response.getObject("data").toString() ) else json.parse(ReportResponseData.ReportError.serializer(), data.toString())
@mustansarsaeed thanks for sharing it