WebThing Server JSON Error

Issue #164 resolved
Turgut Guneysu created an issue

A variable initialized to an empty list

produces a wrongly encoded JSON when accessed via: http://IP/properties/consoleLog

Comments (2)

  1. John Maloney repo owner

    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.

  2. Log in to comment