Skip to content

Bug in JSON::Object.stringify() in 1.5.2 #410

@aleks-f

Description

@aleks-f

From http://pocoproject.org/forum/viewtopic.php?f=12&t=6140&sid=66fde97c7f5b4f054edf3d0f53e3b6b7

postby dedvalson » Mon Mar 17, 2014 11:24 am

The following code produces incorrect output.

        JSON::Object json(true);
        json.set ("foo", 0);
        json.set ("bar", 0);
        json.set ("baz", 0);
        stringstream ss;
        json.stringify(ss);

Here is the output:

"{"bar":0,"bar":0,"bar":0}

This code works (false in the constructor):

        JSON::Object json(false);
        json.set ("foo", 0);
        json.set ("bar", 0);
        json.set ("baz", 0);
        stringstream ss;
        json.stringify(ss);

So does this (different values for the keys):

        JSON::Object json(true);
        json.set ("foo", 1);
        json.set ("bar", 2);
        json.set ("baz", 3);
        stringstream ss;
        json.stringify(ss);

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions