Re: TJSON

@anders: JSON is supposed to be self-describing. Your tools require
up-front knowledge of the expected data types using a schema or similar.

TJSON has the advantage of still being backwards compatible with regular
JSON, although I concede it will output some weird looking tags and values
if you don't string the type annotations.

@emile: Sorry, there were issues with the bridge. I will post the recording
of the call and the one from 2 weeks ago as soon as we have upgraded our
SoundCloud account (we ran out of space on the free account).

On 3 November 2016 at 11:32, Anders Rundgren <anders.rundgren.net@gmail.com>
wrote:

> On 2016-11-03 09:32, Adrian Hope-Bailie wrote:
>
>> For those of you that were on yesterdays call and part of the discussion
>> around encoding formats here's a another to throw in the ring courtesy of a
>> member of this community, Toni Arcieri.
>>
>> https://tonyarcieri.com/introducing-tjson-a-stricter-typed-form-of-json
>>
>> Looks like an interesting option for verbose text encoding of
>> crypto-conditions (for dev and test)...
>>
>
> I don't see the point with introducing a version of JSON that makes
> strings look like "s:Hello world".
> Wouldn't it be more logical to start over from scratch?
>
> All mentioned features and some more are supported by yours truly's JSON
> tools on GitHub (https://github.com/cyberphone/openkeystore/tree/master/
> library/src/org/webpki/json) and that without changing anything in JSON.
>
> Doc: http://webpki.org/papers/keygen2/doc/org/webpki/json/JSONObj
> ectReader.html
>
> If you for example would like to use financial number you would use
> BigDecimals you would for write do
>
>           jsonwriter.setBigDecimal("amount", bigdecimalvalue[, decimals);
>
> while reading
>
>           bigdecimalvalue = jsonreader.getBigDecimal("amount"[,decimals);
>
> That the values are represented a ordinary JSON strings like "599.25"
> doesn't matter, because the parser will reject anything that doesn't fit
> the type in question.
>
> That is, getInt("myval") would reject 1.0 because it is not an integer.
>
> IMO the ES6 specification addresses canonicalization (including property
> order...) good enough.  Add typing on top of that and you're done.
>
> Anders
>
>

Received on Thursday, 3 November 2016 10:55:49 UTC