Peter,

> On 05 Jun 2016, at 13:10, Peter Uhnak <[email protected]> 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



Reply via email to