objectof-group / objectof

Main objectof repository
GNU General Public License v3.0
1 stars 0 forks source link

FYI about issue with json serialization #14

Closed nsherry4 closed 9 years ago

nsherry4 commented 9 years ago

We ran into an issue where serializing a repo to json was giving us invlaid json of the form """": "value" when encoding zero-length mapping keys. It looks like the issue is in IDatatype.toJSONString:37

if (aString == null || aString.length() == 0)
{
  aWriter.append("\"\"");
}
...
aWriter.append('"');
for (i = 0; i < len; i += 1) {
...
}
aWriter.append('"');

It handles the case where the string is empty, but then continues on to handle the non zero-length case.

I've resolved the issue by adding a return statement in the zero-length case, but I just wanted to run this past you since it could be a significant change at a fairly low level.