Hi!
I'm testing rl_json right now. Parsing JSON strings and getting values works fine. But when I try to set values, I'm having some difficulties. Consider the following code:
package require rl_json
set jsonstr {
{
"foo": "Foo",
"baz": "Baz"
}
}
json set jsonstr bar Bar FooBar test {"x"}
puts [json normalize $jsonstr]
json set jsonstr bar Bar FooBar test2 {"y"}
puts [json normalize $jsonstr]
json set jsonstr bar Bar FooBar test3 {"z"}
puts [json normalize $jsonstr]
I'd expect the following end result:
{"foo":"Foo","baz":"Baz","bar":{"Bar":{"FooBar":{"test":"x","test2":"y","test3":"z"}}}}
Instead I get this result:
{"foo":"Foo","baz":"Baz","bar":{"Bar":{"FooBar":{"test":"x","test2":null,"bar":{"Bar":{"FooBar":{"test3":"y"}}},"test3":null}}}}
Another problem I have is changing a value, e.g:
package require rl_json
set jsonstr {
{
"foo": "Foo",
"baz": "Baz"
}
}
json set jsonstr foo {"Bar"}
puts [json normalize $jsonstr]
exits with the error message
missing value to go with key
The speed of the implementation is very impressive. If setting values would work, JSON would really feel like a native datatype of TCL.
Hi!
I'm testing rl_json right now. Parsing JSON strings and getting values works fine. But when I try to set values, I'm having some difficulties. Consider the following code:
I'd expect the following end result:
Instead I get this result:
Another problem I have is changing a value, e.g:
exits with the error message
The speed of the implementation is very impressive. If setting values would work, JSON would really feel like a native datatype of TCL.