June 5, 2016
11:15 a.m.
Peter,
On 05 Jun 2016, at 13:10, Peter Uhnak <i.uhnak@gmail.com> wrote:
Hi,
shouldn't this throw an error instead of producing a broken JSON?
STON toJsonString: ({'a' -> 'b'}) ["a":"b"]
(also STON toJsonString: ('a' -> 'b') => "a":"b")
Clearly I forgot to cast it to dictionary, but shouldn't it throw up?
Thanks, Peter
Yes, when working in JSON compatibility mode, it would better throw an error. The reason for this behaviour is because STON knows the concept of an association as a separate, primitive object. That was a cool contribution done later on. In normal use, you don't see this. I'll have a look. Sven