In browser JSON.serialize is the usual way to serialize JSON values.
The problem is that on D side if one does deserialization of an object or
struct. If the types inside the JSON don't match exactly then vibe freaks
out.

Another problem with most D JSON implementations is that they don't support
proper JSON, e.g. outputting nan as though it was a valid value etc...
browsers don't like that stuff.

For me the best D JSON implementation at the moment is actually jsvar by
Adam and its not even a JSON parser, it just has that as a needed feature.
It feels slow though I haven't benchmarked, but if I run it over a couple
of Gigs of data(Paged by 1000) it takes a long while.



On Thu, Oct 15, 2015 at 3:42 AM, Marco Leise via Digitalmars-d-announce <
digitalmars-d-announce@puremagic.com> wrote:

> Am Wed, 14 Oct 2015 10:22:37 +0200
> schrieb Rory McGuire via Digitalmars-d-announce
> <digitalmars-d-announce@puremagic.com>:
>
> > Does this version handle real world JSON?
> >
> > I've keep getting problems with vibe and JSON because web browsers will
> > automatically make a "1" into a 1 which then causes exceptions in vibe.
> >
> > Does yours do lossless conversions automatically?
>
> No I don't read numbers as strings. Could the client
> JavaScript be fixed? I fail to see why the conversion would
> happen automatically when the code could explicitly check for
> strings before doing math with the value "1". What do I miss?
>
> --
> Marco
>
>

Reply via email to