Created
July 29, 2021 09:43
-
-
Save leegilmorecode/83558d669e68acbcfd119133a0afc39d to your computer and use it in GitHub Desktop.
Very basic example of JSON schema to test a create employee input
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
| export const schema = { | |
| type: "object", | |
| required: ["id", "firstName", "surname", "age"], | |
| maxProperties: 4, | |
| minProperties: 4, | |
| properties: { | |
| id: { | |
| type: "number", | |
| }, | |
| firstName: { | |
| type: "string", | |
| pattern: "^[a-zA-Z]+$", | |
| }, | |
| surname: { | |
| type: "string", | |
| pattern: "^[a-zA-Z]+$", | |
| }, | |
| age: { | |
| type: "number", | |
| }, | |
| }, | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment