Last active
April 7, 2019 04:50
-
-
Save coryhouse/6285539d34c151f593bab319b563b3d2 to your computer and use it in GitHub Desktop.
Mock data schema for randomized user data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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"}]}