Last active
April 15, 2023 15:09
-
-
Save coryhouse/300ed803148caaf9d4f3f45d1a03874d to your computer and use it in GitHub Desktop.
Mock Data Schema for "Building a JavaScript Development Environment" on Pluralsight
This file contains 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
export const 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", "firstName", "lastName", "email"] | |
} | |
} | |
}, | |
"required": ["users"] | |
}; |
oscarigarcia
commented
Apr 26, 2020
via email
Uff!! 👌 Excellent contribution, thank you very much companion
…________________________________
De: AxelPotato <[email protected]>
Enviado: domingo, 26 de abril de 2020 12:44 p. m.
Para: coryhouse <[email protected]>
Cc: Oscary García Sánchez <[email protected]>; Comment <[email protected]>
Asunto: Re: coryhouse/mockDataSchema.js
@AxelPotato commented on this gist.
________________________________
For me it kept creating floats instead of whole numbers.
This fix to the number generating part seemed to do the trick.
id: {
type: 'number',
faker: 'random.number',
unique: true,
minimum: 1
},
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<https://gist.github.com/300ed803148caaf9d4f3f45d1a03874d#gistcomment-3270346>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AMVRSB6DWBD47S2VD4WVW4DROQUELANCNFSM4HHI6NIQ>.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment