Skip to content

Instantly share code, notes, and snippets.

@coryhouse
Last active April 7, 2019 04:50
Show Gist options
  • Save coryhouse/6285539d34c151f593bab319b563b3d2 to your computer and use it in GitHub Desktop.
Save coryhouse/6285539d34c151f593bab319b563b3d2 to your computer and use it in GitHub Desktop.
Mock data schema for randomized user data
var schema = {
"type": "object",
"properties": {
"users": {
"type": "array",
"minItems": 3,
"maxItems": 5,
"items": {
"type": "object",
"properties": {
"id": {
"type": "number",
"unique": true,
"minimum": 1
},
"firstName": {
"type": "string",
"faker": "name.firstName"
},
"lastName": {
"type": "string",
"faker": "name.lastName"
},
"email": {
"type": "string",
"faker": "internet.email"
}
},
"required": ["id", "type", "lastname", "email"]
}
}
},
"required": ["users"]
};
module.exports = schema;
Copy link

ghost commented Oct 3, 2017

This is what I am getting on my db.json using this schema:
{"users":[{"id":83599623.3686758,"firstName":"et dolor quis elit","lastName":"est Lorem cillum eiusmod","email":"esse aliqua"},{"id":95176111.18533652,"firstName":"voluptate fugiat","lastName":"sunt","email":"in est nisi"},{"id":26503812.812322445,"firstName":"dolore officia nisi do","lastName":"esse nul","email":"quis reprehenderit nisi minim"},{"id":9828782.78382918,"firstName":"dolore eiusmod non id cupidatat","lastName":"veniam consequat proident Excepteur sed","email":"laborum incididunt ullam"}]}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment