Skip to content

Instantly share code, notes, and snippets.

@Fannon
Created May 15, 2014 16:25
Show Gist options
  • Save Fannon/e718531f22f9791e1cfc to your computer and use it in GitHub Desktop.
Save Fannon/e718531f22f9791e1cfc to your computer and use it in GitHub Desktop.
tv4.asyncFetchSchemas Usage
tv4.asyncFetchSchemas('/model/Circle.json', function() {
tv4.getSchemaUris();
// ["/model/Circle.json"]
tv4.getSchemaMap();
// {
// "/model/Circle.json": {
// "$ref": "/model/_Shape.json",
// "id": "/model/Circle",
// "description": "Inherits x and y from _Shape",
// "type": "object",
// "properties": {
// "radius": {
// "type": "number"
// }
// },
// "required": ["x", "y", "radius"]
// }
// }
tv4.getSchema();
// TypeError: Cannot read property 'indexOf' of undefined
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment