WebThing Server JSON Error
Issue #164
resolved
A variable initialized to an empty list
produces a wrongly encoded JSON when accessed via: http://IP/properties/consoleLog
Comments (2)
-
repo owner -
repo owner - changed status to resolved
- Log in to comment
I was not able to reproduce this exactly. However, I did make it so that an empty list is reported like this:
{"consoleLog":"[]"}
Note that the value is a JSON string. In this case, the contents of the string could be parsed as a list, but if you have more than 32 elements you might get a string like this:
{"consoleLog":"[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ... and 8 more]"}
To use this mechanism with lists, you should keep the lists short.