declareType: function( | alias, | | uri, | | schema | ) |
|
Declare a remoteStorage object type using a JSON schema.
Parameters
alias | A type alias/shortname |
uri | (optional) JSON-LD URI of the schema. Automatically generated if none given |
schema | A JSON Schema object describing the object type |
Example
client.declareType('todo-item', {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"title": {
"type": "string"
},
"finished": {
"type": "boolean"
"default": false
},
"createdAt": {
"type": "date"
}
},
"required": ["id", "title"]
})
Visit http://json-schema.org for details on how to use JSON Schema.