W3C home > Mailing lists > Public > public-xmlsec@w3.org > January 2014

Emulating XML Schema in JSON

From: Anders Rundgren <anders.rundgren.net@gmail.com>
Date: Wed, 15 Jan 2014 11:48:27 +0100
Message-ID: <52D6677B.7080008@gmail.com>
To: public-xmlsec@w3.org
Continuing along the same path that resulted in JCS (JSON Cleartext Signature), the next frontier is validation.
Although there are efforts creating schema support in JSON, I think they only apply to really complex system which may equally well use XML.

So instead I have taken a programmatic approach, where automatically instantiated classes perform de-serialization and self-validation.

Together with a parser that also notes if JSON data isn't de-serialized, you get a minimalist system depending on two predefined properties (@context and @qualifier), which in essence mimic XML's namespace and top-level elements:

Sample objects:

The class factory:

Received on Wednesday, 15 January 2014 10:49:03 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:55:19 UTC