JSON v2: Difference between revisions

From John's wiki
Jump to navigation Jump to search
(JSON v2)
(work, work...)
Line 1: Line 1:
These are some thoughts on an improved JSON data-format that includes support for namespaces and schema description.
These are some thoughts on an improved JSON data-format that includes support for namespaces and schema description.


Thoughts:
We also want to optionally include a [http://json-schema.org/ JSON schema] for a namespace. Schema could be either inline or a URL which would return the schema.
 
# is it desirable to optionally include a [http://json-schema.org/ JSON schema] for a namespace? Schema could be either inline or a URL which would return the schema.


  var data = {
  var data = {

Revision as of 12:57, 8 July 2017

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

We also want 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
        }
      ]
    }
  }
};