W3C home > Mailing lists > Public > public-interledger@w3.org > November 2016

Re: TJSON

From: Adrian Hope-Bailie <adrian@hopebailie.com>
Date: Thu, 3 Nov 2016 12:55:16 +0200
Message-ID: <CA+eFz_K0wZRPN711N_H1bX-QYkP_MH5SygCn_KAB8JzmjYFQwg@mail.gmail.com>
To: Anders Rundgren <anders.rundgren.net@gmail.com>
Cc: Interledger Community Group <public-interledger@w3.org>
@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

This archive was generated by hypermail 2.3.1 : Thursday, 3 November 2016 10:55:50 UTC