[Issue 22612] std.json doesn't parse duplicate keys

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Dec 20 09:14:40 UTC 2021


https://issues.dlang.org/show_bug.cgi?id=22612

Salih Dincer <salihdb at hotmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |salihdb at hotmail.com

--- Comment #1 from Salih Dincer <salihdb at hotmail.com> ---
Probably, but the 2nd object with the same name is overwritten with the 1st. 
In summary, data points to a single object.

NodeJS has the same effect:

const jsonStr ='{"name":"Salih","age":42,"name":"SALIH"}';
const data = JSON.parse(jsonStr);

var assert = require('assert');
assert(data.name != "Salih");

--


More information about the Digitalmars-d-bugs mailing list