Open pashoo2 opened 9 years ago
Your first schema is an array but defined as a you would a "tuple"-like array, see here for information on this. If you want to restrict "tuple"-like array items to only those present in the items array, then you must add "additionalItems": false
to your array schema. Adding this key to your schema resulted in the _id
and guid
fields being identified as the incorrect type. See here for an edited version of your example that works correctly. Additionally, the "required"
key has no meaning in an array, as far as I know.
It looks like your goal is to ensure that all items in your array match a certain format, in that case it would be more practical to set the "items"
key to a schema object directly, as you can see here.
For your second issue, I ran the following code and received a result of true
. Can you provide an example where this is not working?
var j = require('is-my-json-valid');
var schema = {
type: "number",
multipleOf: 0.0001
};
var obj = 1;
var validate = j(schema, { verbose: true });
var res = validate(obj);
console.log(res);
if (!res) {
console.log(validate.errors);
}
Thank you for explaining the problems with the first schema. May be the second problem has been resolved. The first error as an example, it does not for working application
This schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "/",
"type": "array",
"additionalItems": false,
"items": [
{
"id": "0",
"type": "object",
"properties": {
"_id": {
"id": "_id",
"type": "string",
"minLength": 1
},
"index": {
"id": "index",
"type": "integer"
},
"guid": {
"id": "guid",
"type": "string",
"minLength": 1
},
"isActive": {
"id": "isActive",
"type": "boolean"
},
"balance": {
"id": "balance",
"type": "string",
"minLength": 1
},
"picture": {
"id": "picture",
"type": "string",
"minLength": 1
},
"age": {
"id": "age",
"type": "integer"
},
"eyeColor": {
"id": "eyeColor",
"type": "string",
"minLength": 1
},
"name": {
"id": "name",
"type": "string",
"minLength": 1
},
"gender": {
"id": "gender",
"type": "string",
"minLength": 1
},
"company": {
"id": "company",
"type": "string",
"minLength": 1
},
"email": {
"id": "email",
"type": "string",
"minLength": 1
},
"phone": {
"id": "phone",
"type": "string",
"minLength": 1
},
"address": {
"id": "address",
"type": "string",
"minLength": 1
},
"about": {
"id": "about",
"type": "string",
"minLength": 1
},
"registered": {
"id": "registered",
"type": "string",
"minLength": 1
},
"latitude": {
"id": "latitude",
"type": "number"
},
"longitude": {
"id": "longitude",
"type": "number"
},
"tags": {
"id": "tags",
"type": "array",
"items": [
{
"id": "0",
"type": "string",
"minLength": 1
},
{
"id": "1",
"type": "string",
"minLength": 1
},
{
"id": "2",
"type": "string",
"minLength": 1
},
{
"id": "3",
"type": "string",
"minLength": 1
},
{
"id": "4",
"type": "string",
"minLength": 1
},
{
"id": "5",
"type": "string",
"minLength": 1
},
{
"id": "6",
"type": "string",
"minLength": 1
}
],
"additionalItems": false
},
"friends": {
"id": "friends",
"type": "array",
"items": [
{
"id": "0",
"type": "object",
"properties": {
"id": {
"id": "id",
"type": "integer"
},
"name": {
"id": "name",
"type": "string",
"minLength": 1
}
},
"additionalProperties": false
},
{
"id": "1",
"type": "object",
"properties": {
"id": {
"id": "id",
"type": "integer"
},
"name": {
"id": "name",
"type": "string",
"minLength": 1
}
},
"additionalProperties": false
},
{
"id": "2",
"type": "object",
"properties": {
"id": {
"id": "id",
"type": "integer"
},
"name": {
"id": "name",
"type": "string",
"minLength": 1
}
},
"additionalProperties": false
},
{
"id": "3",
"type": "object",
"properties": {
"id": {
"id": "id",
"type": "integer"
},
"name": {
"id": "name",
"type": "string",
"minLength": 1
}
},
"additionalProperties": false
},
{
"id": "4",
"type": "object",
"properties": {
"id": {
"id": "id",
"type": "integer"
},
"name": {
"id": "name",
"type": "string",
"minLength": 1
}
},
"additionalProperties": false
}
],
"additionalItems": false
},
"greeting": {
"id": "greeting",
"type": "string",
"minLength": 1
},
"favoriteFruit": {
"id": "favoriteFruit",
"type": "string",
"minLength": 1
}
},
"additionalProperties": false,
"required": [
"_id",
"index",
"guid",
"isActive",
"balance",
"picture",
"age",
"eyeColor",
"name",
"gender",
"company",
"email",
"phone",
"address",
"about",
"registered",
"latitude",
"longitude",
"tags",
"friends",
"greeting",
"favoriteFruit"
]
},
{
"id": "1",
"type": "object",
"properties": {
"_id": {
"id": "_id",
"type": "string",
"minLength": 1
},
"index": {
"id": "index",
"type": "integer"
},
"guid": {
"id": "guid",
"type": "string",
"minLength": 1
},
"isActive": {
"id": "isActive",
"type": "boolean"
},
"balance": {
"id": "balance",
"type": "string",
"minLength": 1
},
"picture": {
"id": "picture",
"type": "string",
"minLength": 1
},
"age": {
"id": "age",
"type": "integer"
},
"eyeColor": {
"id": "eyeColor",
"type": "string",
"minLength": 1
},
"name": {
"id": "name",
"type": "string",
"minLength": 1
},
"gender": {
"id": "gender",
"type": "string",
"minLength": 1
},
"company": {
"id": "company",
"type": "string",
"minLength": 1
},
"email": {
"id": "email",
"type": "string",
"minLength": 1
},
"phone": {
"id": "phone",
"type": "string",
"minLength": 1
},
"address": {
"id": "address",
"type": "string",
"minLength": 1
},
"about": {
"id": "about",
"type": "string",
"minLength": 1
},
"registered": {
"id": "registered",
"type": "string",
"minLength": 1
},
"latitude": {
"id": "latitude",
"type": "number"
},
"longitude": {
"id": "longitude",
"type": "number"
},
"tags": {
"id": "tags",
"type": "array",
"items": [
{
"id": "0",
"type": "string",
"minLength": 1
},
{
"id": "1",
"type": "string",
"minLength": 1
},
{
"id": "2",
"type": "string",
"minLength": 1
},
{
"id": "3",
"type": "string",
"minLength": 1
},
{
"id": "4",
"type": "string",
"minLength": 1
},
{
"id": "5",
"type": "string",
"minLength": 1
},
{
"id": "6",
"type": "string",
"minLength": 1
}
],
"additionalItems": false
},
"friends": {
"id": "friends",
"type": "array",
"items": [
{
"id": "0",
"type": "object",
"properties": {
"id": {
"id": "id",
"type": "integer"
},
"name": {
"id": "name",
"type": "string",
"minLength": 1
}
},
"additionalProperties": false
},
{
"id": "1",
"type": "object",
"properties": {
"id": {
"id": "id",
"type": "integer"
},
"name": {
"id": "name",
"type": "string",
"minLength": 1
}
},
"additionalProperties": false
},
{
"id": "2",
"type": "object",
"properties": {
"id": {
"id": "id",
"type": "integer"
},
"name": {
"id": "name",
"type": "string",
"minLength": 1
}
},
"additionalProperties": false
},
{
"id": "3",
"type": "object",
"properties": {
"id": {
"id": "id",
"type": "integer"
},
"name": {
"id": "name",
"type": "string",
"minLength": 1
}
},
"additionalProperties": false
},
{
"id": "4",
"type": "object",
"properties": {
"id": {
"id": "id",
"type": "integer"
},
"name": {
"id": "name",
"type": "string",
"minLength": 1
}
},
"additionalProperties": false
}
],
"additionalItems": false
},
"greeting": {
"id": "greeting",
"type": "string",
"minLength": 1
},
"favoriteFruit": {
"id": "favoriteFruit",
"type": "string",
"minLength": 1
}
},
"additionalProperties": false
},
{
"id": "2",
"type": "object",
"properties": {
"_id": {
"id": "_id",
"type": "string",
"minLength": 1
},
"index": {
"id": "index",
"type": "integer"
},
"guid": {
"id": "guid",
"type": "string",
"minLength": 1
},
"isActive": {
"id": "isActive",
"type": "boolean"
},
"balance": {
"id": "balance",
"type": "string",
"minLength": 1
},
"picture": {
"id": "picture",
"type": "string",
"minLength": 1
},
"age": {
"id": "age",
"type": "integer"
},
"eyeColor": {
"id": "eyeColor",
"type": "string",
"minLength": 1
},
"name": {
"id": "name",
"type": "string",
"minLength": 1
},
"gender": {
"id": "gender",
"type": "string",
"minLength": 1
},
"company": {
"id": "company",
"type": "string",
"minLength": 1
},
"email": {
"id": "email",
"type": "string",
"minLength": 1
},
"phone": {
"id": "phone",
"type": "string",
"minLength": 1
},
"address": {
"id": "address",
"type": "string",
"minLength": 1
},
"about": {
"id": "about",
"type": "string",
"minLength": 1
},
"registered": {
"id": "registered",
"type": "string",
"minLength": 1
},
"latitude": {
"id": "latitude",
"type": "number"
},
"longitude": {
"id": "longitude",
"type": "number"
},
"tags": {
"id": "tags",
"type": "array",
"items": [
{
"id": "0",
"type": "string",
"minLength": 1
},
{
"id": "1",
"type": "string",
"minLength": 1
},
{
"id": "2",
"type": "string",
"minLength": 1
},
{
"id": "3",
"type": "string",
"minLength": 1
},
{
"id": "4",
"type": "string",
"minLength": 1
},
{
"id": "5",
"type": "string",
"minLength": 1
},
{
"id": "6",
"type": "string",
"minLength": 1
}
],
"additionalItems": false
},
"friends": {
"id": "friends",
"type": "array",
"items": [
{
"id": "0",
"type": "object",
"properties": {
"id": {
"id": "id",
"type": "integer"
},
"name": {
"id": "name",
"type": "string",
"minLength": 1
}
},
"additionalProperties": false
},
{
"id": "1",
"type": "object",
"properties": {
"id": {
"id": "id",
"type": "integer"
},
"name": {
"id": "name",
"type": "string",
"minLength": 1
}
},
"additionalProperties": false
},
{
"id": "2",
"type": "object",
"properties": {
"id": {
"id": "id",
"type": "integer"
},
"name": {
"id": "name",
"type": "string",
"minLength": 1
}
},
"additionalProperties": false
},
{
"id": "3",
"type": "object",
"properties": {
"id": {
"id": "id",
"type": "integer"
},
"name": {
"id": "name",
"type": "string",
"minLength": 1
}
},
"additionalProperties": false
},
{
"id": "4",
"type": "object",
"properties": {
"id": {
"id": "id",
"type": "integer"
},
"name": {
"id": "name",
"type": "string",
"minLength": 1
}
},
"additionalProperties": false
}
],
"additionalItems": false
},
"greeting": {
"id": "greeting",
"type": "string",
"minLength": 1
},
"favoriteFruit": {
"id": "favoriteFruit",
"type": "string",
"minLength": 1
}
},
"additionalProperties": false
},
{
"id": "3",
"type": "object",
"properties": {
"_id": {
"id": "_id",
"type": "string",
"minLength": 1
},
"index": {
"id": "index",
"type": "integer"
},
"guid": {
"id": "guid",
"type": "string",
"minLength": 1
},
"isActive": {
"id": "isActive",
"type": "boolean"
},
"balance": {
"id": "balance",
"type": "string",
"minLength": 1
},
"picture": {
"id": "picture",
"type": "string",
"minLength": 1
},
"age": {
"id": "age",
"type": "integer"
},
"eyeColor": {
"id": "eyeColor",
"type": "string",
"minLength": 1
},
"name": {
"id": "name",
"type": "string",
"minLength": 1
},
"gender": {
"id": "gender",
"type": "string",
"minLength": 1
},
"company": {
"id": "company",
"type": "string",
"minLength": 1
},
"email": {
"id": "email",
"type": "string",
"minLength": 1
},
"phone": {
"id": "phone",
"type": "string",
"minLength": 1
},
"address": {
"id": "address",
"type": "string",
"minLength": 1
},
"about": {
"id": "about",
"type": "string",
"minLength": 1
},
"registered": {
"id": "registered",
"type": "string",
"minLength": 1
},
"latitude": {
"id": "latitude",
"type": "number"
},
"longitude": {
"id": "longitude",
"type": "number"
},
"tags": {
"id": "tags",
"type": "array",
"items": [
{
"id": "0",
"type": "string",
"minLength": 1
},
{
"id": "1",
"type": "string",
"minLength": 1
},
{
"id": "2",
"type": "string",
"minLength": 1
},
{
"id": "3",
"type": "string",
"minLength": 1
},
{
"id": "4",
"type": "string",
"minLength": 1
},
{
"id": "5",
"type": "string",
"minLength": 1
},
{
"id": "6",
"type": "string",
"minLength": 1
}
],
"additionalItems": false
},
"friends": {
"id": "friends",
"type": "array",
"items": [
{
"id": "0",
"type": "object",
"properties": {
"id": {
"id": "id",
"type": "integer"
},
"name": {
"id": "name",
"type": "string",
"minLength": 1
}
},
"additionalProperties": false
},
{
"id": "1",
"type": "object",
"properties": {
"id": {
"id": "id",
"type": "integer"
},
"name": {
"id": "name",
"type": "string",
"minLength": 1
}
},
"additionalProperties": false
},
{
"id": "2",
"type": "object",
"properties": {
"id": {
"id": "id",
"type": "integer"
},
"name": {
"id": "name",
"type": "string",
"minLength": 1
}
},
"additionalProperties": false
},
{
"id": "3",
"type": "object",
"properties": {
"id": {
"id": "id",
"type": "integer"
},
"name": {
"id": "name",
"type": "string",
"minLength": 1
}
},
"additionalProperties": false
},
{
"id": "4",
"type": "object",
"properties": {
"id": {
"id": "id",
"type": "integer"
},
"name": {
"id": "name",
"type": "string",
"minLength": 1
}
},
"additionalProperties": false
}
],
"additionalItems": false
},
"greeting": {
"id": "greeting",
"type": "string",
"minLength": 1
},
"favoriteFruit": {
"id": "favoriteFruit",
"type": "string",
"minLength": 1
}
},
"additionalProperties": false
},
{
"id": "4",
"type": "object",
"properties": {
"_id": {
"id": "_id",
"type": "string",
"minLength": 1
},
"index": {
"id": "index",
"type": "integer"
},
"guid": {
"id": "guid",
"type": "string",
"minLength": 1
},
"isActive": {
"id": "isActive",
"type": "boolean"
},
"balance": {
"id": "balance",
"type": "string",
"minLength": 1
},
"picture": {
"id": "picture",
"type": "string",
"minLength": 1
},
"age": {
"id": "age",
"type": "integer"
},
"eyeColor": {
"id": "eyeColor",
"type": "string",
"minLength": 1
},
"name": {
"id": "name",
"type": "string",
"minLength": 1
},
"gender": {
"id": "gender",
"type": "string",
"minLength": 1
},
"company": {
"id": "company",
"type": "string",
"minLength": 1
},
"email": {
"id": "email",
"type": "string",
"minLength": 1
},
"phone": {
"id": "phone",
"type": "string",
"minLength": 1
},
"address": {
"id": "address",
"type": "string",
"minLength": 1
},
"about": {
"id": "about",
"type": "string",
"minLength": 1
},
"registered": {
"id": "registered",
"type": "string",
"minLength": 1
},
"latitude": {
"id": "latitude",
"type": "number"
},
"longitude": {
"id": "longitude",
"type": "number"
},
"tags": {
"id": "tags",
"type": "array",
"items": [
{
"id": "0",
"type": "string",
"minLength": 1
},
{
"id": "1",
"type": "string",
"minLength": 1
},
{
"id": "2",
"type": "string",
"minLength": 1
},
{
"id": "3",
"type": "string",
"minLength": 1
},
{
"id": "4",
"type": "string",
"minLength": 1
},
{
"id": "5",
"type": "string",
"minLength": 1
},
{
"id": "6",
"type": "string",
"minLength": 1
}
],
"additionalItems": false
},
"friends": {
"id": "friends",
"type": "array",
"items": [
{
"id": "0",
"type": "object",
"properties": {
"id": {
"id": "id",
"type": "integer"
},
"name": {
"id": "name",
"type": "string",
"minLength": 1
}
},
"additionalProperties": false
},
{
"id": "1",
"type": "object",
"properties": {
"id": {
"id": "id",
"type": "integer"
},
"name": {
"id": "name",
"type": "string",
"minLength": 1
}
},
"additionalProperties": false
},
{
"id": "2",
"type": "object",
"properties": {
"id": {
"id": "id",
"type": "integer"
},
"name": {
"id": "name",
"type": "string",
"minLength": 1
}
},
"additionalProperties": false
},
{
"id": "3",
"type": "object",
"properties": {
"id": {
"id": "id",
"type": "integer"
},
"name": {
"id": "name",
"type": "string",
"minLength": 1
}
},
"additionalProperties": false
},
{
"id": "4",
"type": "object",
"properties": {
"id": {
"id": "id",
"type": "integer"
},
"name": {
"id": "name",
"type": "string",
"minLength": 1
}
},
"additionalProperties": false
}
],
"additionalItems": false
},
"greeting": {
"id": "greeting",
"type": "string",
"minLength": 1
},
"favoriteFruit": {
"id": "favoriteFruit",
"type": "string",
"minLength": 1
}
},
"additionalProperties": false
},
{
"id": "5",
"type": "object",
"properties": {
"_id": {
"id": "_id",
"type": "string",
"minLength": 1
},
"index": {
"id": "index",
"type": "integer"
},
"guid": {
"id": "guid",
"type": "string",
"minLength": 1
},
"isActive": {
"id": "isActive",
"type": "boolean"
},
"balance": {
"id": "balance",
"type": "string",
"minLength": 1
},
"picture": {
"id": "picture",
"type": "string",
"minLength": 1
},
"age": {
"id": "age",
"type": "integer"
},
"eyeColor": {
"id": "eyeColor",
"type": "string",
"minLength": 1
},
"name": {
"id": "name",
"type": "string",
"minLength": 1
},
"gender": {
"id": "gender",
"type": "string",
"minLength": 1
},
"company": {
"id": "company",
"type": "string",
"minLength": 1
},
"email": {
"id": "email",
"type": "string",
"minLength": 1
},
"phone": {
"id": "phone",
"type": "string",
"minLength": 1
},
"address": {
"id": "address",
"type": "string",
"minLength": 1
},
"about": {
"id": "about",
"type": "string",
"minLength": 1
},
"registered": {
"id": "registered",
"type": "string",
"minLength": 1
},
"latitude": {
"id": "latitude",
"type": "number"
},
"longitude": {
"id": "longitude",
"type": "number"
},
"tags": {
"id": "tags",
"type": "array",
"items": [
{
"id": "0",
"type": "string",
"minLength": 1
},
{
"id": "1",
"type": "string",
"minLength": 1
},
{
"id": "2",
"type": "string",
"minLength": 1
},
{
"id": "3",
"type": "string",
"minLength": 1
},
{
"id": "4",
"type": "string",
"minLength": 1
},
{
"id": "5",
"type": "string",
"minLength": 1
},
{
"id": "6",
"type": "string",
"minLength": 1
}
],
"additionalItems": false
},
"friends": {
"id": "friends",
"type": "array",
"items": [
{
"id": "0",
"type": "object",
"properties": {
"id": {
"id": "id",
"type": "integer"
},
"name": {
"id": "name",
"type": "string",
"minLength": 1
}
},
"additionalProperties": false
},
{
"id": "1",
"type": "object",
"properties": {
"id": {
"id": "id",
"type": "integer"
},
"name": {
"id": "name",
"type": "string",
"minLength": 1
}
},
"additionalProperties": false
},
{
"id": "2",
"type": "object",
"properties": {
"id": {
"id": "id",
"type": "integer"
},
"name": {
"id": "name",
"type": "string",
"minLength": 1
}
},
"additionalProperties": false
},
{
"id": "3",
"type": "object",
"properties": {
"id": {
"id": "id",
"type": "integer"
},
"name": {
"id": "name",
"type": "string",
"minLength": 1
}
},
"additionalProperties": false
},
{
"id": "4",
"type": "object",
"properties": {
"id": {
"id": "id",
"type": "integer"
},
"name": {
"id": "name",
"type": "string",
"minLength": 1
}
},
"additionalProperties": false
}
],
"additionalItems": false
},
"greeting": {
"id": "greeting",
"type": "string",
"minLength": 1
},
"favoriteFruit": {
"id": "favoriteFruit",
"type": "string",
"minLength": 1
registered }
},
"additionalProperties": false
},
{
"id": "6",
"type": "object",
"properties": {
"_id": {
"id": "_id",
"type": "string",
"minLength": 1
},
"index": {
"id": "index",
"type": "integer"
},
"guid": {
"id": "guid",
"type": "string",
"minLength": 1
},
"isActive": {
"id": "isActive",
"type": "boolean"
},
"balance": {
"id": "balance",
"type": "string",
"minLength": 1
},
"picture": {
"id": "picture",
"type": "string",
"minLength": 1
},
"age": {
"id": "age",
"type": "integer"
},
"eyeColor": {
"id": "eyeColor",
"type": "string",
"minLength": 1
},
"name": {
"id": "name",
"type": "string",
"minLength": 1
},
"gender": {
"id": "gender",
"type": "string",
"minLength": 1
},
"company": {
"id": "company",
"type": "string",
"minLength": 1
},
"email": {
"id": "email",
"type": "string",
"minLength": 1
},
"phone": {
"id": "phone",
"type": "string",
"minLength": 1
},
"address": {
"id": "address",
"type": "string",
"minLength": 1
},
"about": {
"id": "about",
"type": "string",
"minLength": 1
},
"registered": {
"id": "registered",
"type": "string",
"minLength": 1
},
"latitude": {
"id": "latitude",
"type": "number"
},
"longitude": {
"id": "longitude",
"type": "number"
},
"tags": {
"id": "tags",
"type": "array",
"items": [
{
"id": "0",
"type": "string",
"minLength": 1
},
{
"id": "1",
"type": "string",
"minLength": 1
},
{
"id": "2",
"type": "string",
"minLength": 1
},
{
"id": "3",
"type": "string",
"minLength": 1
},
{
"id": "4",
"type": "string",
"minLength": 1
},
{
"id": "5",
"type": "string",
"minLength": 1
},
{
"id": "6",
"type": "string",
"minLength": 1
}
],
"additionalItems": false
},
"friends": {
"id": "friends",
"type": "array",
"items": [
{
"id": "0",
"type": "object",
"properties": {
"id": {
"id": "id",
"type": "integer"
},
"name": {
"id": "name",
"type": "string",
"minLength": 1
}
},
"additionalProperties": false
},
{
"id": "1",
"type": "object",
"properties": {
"id": {
"id": "id",
"type": "integer"
},
"name": {
"id": "name",
"type": "string",
"minLength": 1
}
},
"additionalProperties": false
},
{
"id": "2",
"type": "object",
"properties": {
"id": {
"id": "id",
"type": "integer"
},
"name": {
"id": "name",
"type": "string",
"minLength": 1
}
},
"additionalProperties": false
},
{
"id": "3",
"type": "object",
"properties": {
"id": {
"id": "id",
"type": "integer"
},
"name": {
"id": "name",
"type": "string",
"minLength": 1
}
},
"additionalProperties": false
},
{
"id": "4",
"type": "object",
"properties": {
"id": {
"id": "id",
"type": "integer"
},
"name": {
"id": "name",
"type": "string",
"minLength": 1
}
},
"additionalProperties": false
}
],
"additionalItems": false
},
"greeting": {
"id": "greeting",
"type": "string",
"minLength": 1
},
"favoriteFruit": {
"id": "favoriteFruit",
"type": "string",
"minLength": 1
}
},
"additionalProperties": false
}
],
"required": [
"0",
"1",
"2",
"3",
"4",
"5",
"6"
]
};
FOR THIS OBJECT:
[
{
"_id": "5566a9d607f9a131f6d7ad1b",
"index": 0,
"guid": "6a700eff-affc-41ea-ae58-de1be45562b5",
"isActive": true,
"balance": "$3,654.50",
"picture": "http://placehold.it/32x32",
"age": 32,
"eyeColor": "green",
"name": "Stevens Dixon",
"gender": "male",
"company": "COMSTRUCT",
"email": "stevensdixon@comstruct.com",
"phone": "+1 (830) 458-2040",
"address": "467 Bowne Street, Dexter, Nebraska, 9349",
"about": "Qui consectetur duis reprehenderit labore ea ipsum sunt id. Culpa minim ut ex sunt commodo laboris nostrud aute adipisicing dolor labore commodo esse. Adipisicing ut nisi eu et culpa enim eiusmod consequat sint. Nisi consectetur deserunt proident pariatur aute. Officia culpa amet veniam nulla cillum sunt. Sunt minim voluptate eiusmod qui consequat in in amet.\r\n",
"registered": "2014-08-16T07:23:57 -04:00",
"latitude": -55.373443,
"longitude": 3.252116,
"tags": [
"ullamco",
"aliqua",
"sint",
"eu",
"in",
"in",
"exercitation"
],
"friends": [
{
"id": 0,
"name": "Marks Chandler"
},
{
"id": 1,
"name": "Walton Marks"
},
{
"id": 2,
"name": "Marie Rasmussen"
},
{
"id": 3,
"name": "Long David"
},
{
"id": 4,
"name": "Kathie Hansen"
}
],
"greeting": "Hello, Stevens Dixon! You have 10 unread messages.",
"favoriteFruit": "apple"
},
{
"_id": "5566a9d6000693abc41c6c33",
"index": 1,
"guid": "2d57a01f-2080-4291-b40e-d4dd7ddb84d5",
"isActive": true,
"balance": "$1,880.01",
"picture": "http://placehold.it/32x32",
"age": 20,
"eyeColor": "brown",
"name": "Lorrie Spence",
"gender": "female",
"company": "EXTRAWEAR",
"email": "lorriespence@extrawear.com",
"phone": "+1 (893) 516-2065",
"address": "197 Ash Street, Eastvale, Montana, 9099",
"about": "Lorem non in est sit deserunt adipisicing commodo et consequat cupidatat voluptate exercitation labore adipisicing. Officia tempor commodo incididunt excepteur consequat et aliqua aute veniam. Dolor voluptate cillum dolore cillum nisi officia ad in nostrud qui ex. Officia veniam esse sint nisi fugiat qui tempor aliquip sunt fugiat.\r\n",
"registered": "2014-12-29T04:28:07 -04:00",
"latitude": -30.852935,
"longitude": 15.010266,
"tags": [
"non",
"deserunt",
"consectetur",
"proident",
"incididunt",
"magna",
"ut"
],
"friends": [
{
"id": 0,
"name": "Ballard Joyner"
},
{
"id": 1,
"name": "Chrystal Goodwin"
},
{
"id": 2,
"name": "Hahn Flynn"
},
{
"id": 3,
"name": "Obrien Meyers"
},
{
"id": 4,
"name": "Daniels Chapman"
}
],
"greeting": "Hello, Lorrie Spence! You have 10 unread messages.",
"favoriteFruit": "banana"
},
{
"_id": "5566a9d6b7296e3fbb5e850e",
"index": 2,
"guid": "f8bd6321-3f00-4099-a7de-a19415ecf387",
"isActive": false,
"balance": "$2,135.77",
"picture": "http://placehold.it/32x32",
"age": 40,
"eyeColor": "brown",
"name": "Short Dominguez",
"gender": "male",
"company": "NETAGY",
"email": "shortdominguez@netagy.com",
"phone": "+1 (957) 462-3874",
"address": "419 Diamond Street, Harrison, South Carolina, 366",
"about": "Pariatur sit culpa laborum cillum duis velit sunt cupidatat aliqua. Eiusmod culpa sint mollit excepteur cupidatat officia. Sunt est pariatur minim tempor ipsum exercitation adipisicing nisi proident cillum adipisicing. Do in elit culpa sint sint enim. Commodo dolor sint nostrud elit velit consectetur deserunt aliquip exercitation ullamco aliquip dolore duis. Eu nulla tempor aute sit eiusmod est duis nisi ullamco adipisicing. Culpa reprehenderit tempor proident dolore ex est.\r\n",
"registered": "2014-04-26T00:17:22 -04:00",
"latitude": -79.015436,
"longitude": -89.814684,
"tags": [
"laboris",
"ut",
"irure",
"culpa",
"aute",
"mollit",
"nulla"
],
"friends": [
{
"id": 0,
"name": "Carlson Ortega"
},
{
"id": 1,
"name": "Brandie Reese"
},
{
"id": 2,
"name": "Gabriela Edwards"
},
{
"id": 3,
"name": "Carmella Holcomb"
},
{
"id": 4,
"name": "Tyson Crawford"
}
],
"greeting": "Hello, Short Dominguez! You have 9 unread messages.",
"favoriteFruit": "banana"
},
{
"_id": "5566a9d6c746d50a3cd00731",
"index": 3,
"guid": "2d51346d-c897-41c8-88b2-1106c1c8f9b8",
"isActive": false,
"balance": "$2,575.34",
"picture": "http://placehold.it/32x32",
"age": 34,
"eyeColor": "brown",
"name": "Sheppard Stuart",
"gender": "male",
"company": "INVENTURE",
"email": "sheppardstuart@inventure.com",
"phone": "+1 (832) 452-3682",
"address": "741 Wallabout Street, Vaughn, Connecticut, 9206",
"about": "Ea cupidatat qui aliquip pariatur eiusmod eiusmod consequat. Sunt fugiat elit consectetur elit. Culpa nostrud ad magna non non ad voluptate pariatur cillum sunt. Duis minim voluptate anim sunt non culpa incididunt tempor deserunt nostrud consequat. Proident culpa cupidatat Lorem laboris est culpa dolor do. In fugiat consectetur sunt commodo nostrud ipsum minim consequat ullamco nulla. Et eu sunt dolore nulla laborum elit consectetur est.\r\n",
"registered": "2015-05-18T22:44:03 -04:00",
"latitude": -51.096724,
"longitude": -175.467606,
"tags": [
"adipisicing",
"esse",
"non",
"voluptate",
"est",
"ad",
"ut"
],
"friends": [
{
"id": 0,
"name": "Estelle King"
},
{
"id": 1,
"name": "Crane Savage"
},
{
"id": 2,
"name": "Vanessa Salazar"
},
{
"id": 3,
"name": "Sue Mcneil"
},
{
"id": 4,
"name": "Duke Park"
}
],
"greeting": "Hello, Sheppard Stuart! You have 5 unread messages.",
"favoriteFruit": "strawberry"
},
{
"_id": "5566a9d6c5d56bb6c95407c5",
"index": 4,
"guid": "9593b9c2-25dc-41b9-a7b9-634cf4b134f2",
"isActive": true,
"balance": "$2,058.26",
"picture": "http://placehold.it/32x32",
"age": 27,
"eyeColor": "blue",
"name": "Mullen Bishop",
"gender": "male",
"company": "SYBIXTEX",
"email": "mullenbishop@sybixtex.com",
"phone": "+1 (918) 472-2374",
"address": "994 Railroad Avenue, Orin, Hawaii, 5857",
"about": "Sint esse elit cupidatat esse quis nulla officia quis. Duis voluptate sit ea consequat officia fugiat dolore dolor sunt aute elit eiusmod culpa. Voluptate deserunt amet anim tempor Lorem laborum est magna ex eiusmod voluptate. Do consequat consectetur mollit occaecat dolor.\r\n",
"registered": "2015-04-09T08:51:01 -04:00",
"latitude": 7.289673,
"longitude": -33.637138,
"tags": [
"elit",
"irure",
"consectetur",
"voluptate",
"consequat",
"nisi",
"ullamco"
],
"friends": [
{
"id": 0,
"name": "Leonard Howell"
},
{
"id": 1,
"name": "Holder Kemp"
},
{
"id": 2,
"name": "Vaughan Harrison"
},
{
"id": 3,
"name": "Dorothy Lara"
},
{
"id": 4,
"name": "Villarreal Padilla"
}
],
"greeting": "Hello, Mullen Bishop! You have 9 unread messages.",
"favoriteFruit": "banana"
},
{
"_id": "5566a9d6d63efc6d39a20a08",
"index": 5,
"guid": "2e649c29-9c3b-4149-a4bc-db2072bc538f",
"isActive": false,
"balance": "$3,981.37",
"picture": "http://placehold.it/32x32",
"age": 35,
"eyeColor": "brown",
"name": "Alvarez Kinney",
"gender": "male",
"company": "IMPERIUM",
"email": "alvarezkinney@imperium.com",
"phone": "+1 (962) 554-3446",
"address": "485 Bedell Lane, Grapeview, Federated States Of Micronesia, 7284",
"about": "Cillum occaecat sint irure officia. Adipisicing proident ex pariatur officia duis irure irure laborum quis id sit. Eu aliquip aliquip aliqua voluptate laboris ea tempor consectetur. Reprehenderit tempor est consectetur officia nulla proident do ea.\r\n",
"registered": "2014-06-17T00:02:32 -04:00",
"latitude": -38.757573,
"longitude": 55.134106,
"tags": [
"commodo",
"consectetur",
"exercitation",
"elit",
"occaecat",
"ut",
"cillum"
],
"friends": [
{
"id": 0,
"name": "Manuela Wynn"
},
{
"id": 1,
"name": "Jeanette Bridges"
},
{
"id": 2,
"name": "Meghan Rosa"
},
{
"id": 3,
"name": "Calderon Arnold"
},
{
"id": 4,
"name": "Lakeisha Shields"
}
],
"greeting": "Hello, Alvarez Kinney! You have 9 unread messages.",
"favoriteFruit": "apple"
},
{
"_id": "5566a9d6d9a2a5431ad704c9",
"index": 6,
"guid": "66242077-9976-4ca9-87b3-b582de8fcac2",
"isActive": false,
"balance": "$3,485.69",
"picture": "http://placehold.it/32x32",
"age": 37,
"eyeColor": "blue",
"name": "Rosalinda Conway",
"gender": "female",
"company": "AQUASSEUR",
"email": "rosalindaconway@aquasseur.com",
"phone": "+1 (937) 564-3403",
"address": "104 Hastings Street, Newkirk, Virginia, 862",
"about": "Ipsum sunt eu sit eiusmod. Voluptate commodo esse non aliqua ex anim proident pariatur elit mollit aliquip. Occaecat ipsum voluptate elit do ullamco commodo culpa ipsum ut fugiat. Sunt sit magna eiusmod cupidatat enim Lorem elit velit adipisicing anim. Aliqua eu consequat duis duis exercitation eiusmod do ut exercitation cupidatat nisi. Consequat veniam nisi quis et velit et.\r\n",
"registered": "2014-01-19T04:37:53 -04:00",
"registered_1": "2014-01-19T04:37:53 -04:00",
"latitude": -84.587131,
"longitude": 175.762026,
"tags": [
"Lorem",
"ut",
"eiusmod",
"est",
"adipisicing",
"anim",
"esse"
],
"friends": [
{
"id": 0,
"name": "Oneal Melendez"
},
{
"id": 1,
"name": "Hudson Hickman"
},
{
"id": 2,
"name": "Carolyn Mckenzie"
},
{
"id": 3,
"name": "Perkins Schroeder"
},
{
"id": 4,
"name": "Fleming Trevino"
}
],
"greeting": "Hello, Rosalinda Conway! You have 1 unread messages.",
"favoriteFruit": "strawberry"
}
];
The setting "Additional properties" set to false for all objects into the main array. The object have an additional property called "registered_1", but the result of the library execution is "true"
As you can see in the schema the property "guid" must be a number, but in the object this property is a string. The result of validation is TRUE. That's wrong!
An another example: schema = { type : "number", multipleOf : 0.0001 } object = 1; The result is FALSE, but must be TRUE