Skip to content

Instantly share code, notes, and snippets.

@leegilmorecode
Created July 29, 2021 09:43
Show Gist options
  • Select an option

  • Save leegilmorecode/83558d669e68acbcfd119133a0afc39d to your computer and use it in GitHub Desktop.

Select an option

Save leegilmorecode/83558d669e68acbcfd119133a0afc39d to your computer and use it in GitHub Desktop.
Very basic example of JSON schema to test a create employee input
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