Re: What's a Number? Was: TJSON

On 2016-11-04 18:39, Shane McCarron wrote:
> I couldn't agree more strongly with what David said.  The XSD work is
 > seminal and more than sufficient for anything we might need as far as I know.
> We have done some really interesting things with JSON Schema and JSON-LD.
 > In both cases we just rely on XSD types for the underlying explicit meaning.

Yes, there seems to be many ways mapping unsupported/missing data types as an alternative to explicitly tagging data.

- JSON Schema

- The "old-school" programmatic way: writer.setBigDecimal("amount", bigdecimalvalue)

- Annotations:
    https://golang.org/pkg/encoding/json/#example_Marshal
    Int64String int64 `json:",string"

Providing an explicit mapping table can also be useful:
https://cyberphone.github.io/doc/security/jcs.html#Data_Types

Anders

Received on Saturday, 5 November 2016 07:41:19 UTC