Permalink
Browse files

Fixing the example

  • Loading branch information...
1 parent 51744a9 commit f625cd661bc27752e0564463bf16c84be5aeff3b @tdegrunt committed Dec 20, 2012
Showing with 6 additions and 7 deletions.
  1. +6 −7 examples/ref.js
View
@@ -5,8 +5,8 @@ var Validator = require('../lib/validator');
// Address, to be embedded on Person
var addressSchema = {
- "id": "Simple#Address",
- "type" : "object",
+ "id": "/SimpleAddress",
+ "type": "object",
"properties": {
"lines": {
"type": "array",
@@ -20,11 +20,11 @@ var addressSchema = {
// Person model
var schema = {
- "id": "Simple#Person",
- "type" : "object",
+ "id": "/SimplePerson",
+ "type": "object",
"properties": {
"name": {"type": "string"},
- "address": {"$ref": "Simple#Address"},
+ "address": {"$ref": "/SimpleAddress"},
"votes": {"type": "integer", "minimum": 1}
}
};
@@ -41,6 +41,5 @@ var p = {
};
var v = new Validator();
-v.addSchema(addressSchema, 'Simple#Address');
-p.address = 1235;
+v.addSchema(addressSchema, '/SimpleAddress');
console.log(v.validate(p, schema));

0 comments on commit f625cd6

Please sign in to comment.