Skip to content

Latest commit

 

History

History
49 lines (39 loc) · 821 Bytes

File metadata and controls

49 lines (39 loc) · 821 Bytes

jsonschema

JSON Schema Validator in Cell.js

Demo

Check out the demo here

Usage

There are two ways (You can see an actual usage here: https://github.com/intercellular/jsonschema/blob/master/index.html#L30) :

1. Initialize with static value

Use the value attribute to initialize with your own value.

var app = App({
  schema: {
    value: {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        }
      }
    }
  },
  data: {
    value: {
      "name": "Ethan"
    }
  }
});

2. Initialize with remote JSON

Use the url attribute to fetch a remote JSON object for usage.

var app = App({
  schema: {
    url: "./example/schema.json"
  },
  data: {
    url: "./example/data.json"
  }
});