JSON v2

From John's wiki
Revision as of 12:55, 8 July 2017 by Sixsigma (talk | contribs) (JSON v2)
Jump to navigation Jump to search

These are some thoughts on an improved JSON data-format that includes support for namespaces and schema description.

Thoughts:

  1. is it desirable to optionally include a JSON schema for a namespace? Schema could be either inline or a URL which would return the schema.
var data = {
  "json": {
    "version": 2,
    "namespace": {
      "default": "net.jj5.json.schema.example.v2",
      "ex": "com.example.json.schema.example.v1"
    },
    "data": {
      "people": [
        {
          "first_name": "John",
          "last_name": "Elliot",
          "ex:lucky_number": 37
        }
      ]
    }
  }
};