Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixing the example

  • Loading branch information...
commit f625cd661bc27752e0564463bf16c84be5aeff3b 1 parent 51744a9
@tdegrunt authored
Showing with 6 additions and 7 deletions.
  1. +6 −7 examples/ref.js
View
13 examples/ref.js
@@ -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));
Please sign in to comment.
Something went wrong with that request. Please try again.