Skip to content

Instantly share code, notes, and snippets.

@JonJam
Last active September 11, 2017 07:40
Show Gist options
  • Save JonJam/fd8fe791cb9c6122009b11b0058fbec0 to your computer and use it in GitHub Desktop.
Save JonJam/fd8fe791cb9c6122009b11b0058fbec0 to your computer and use it in GitHub Desktop.
Schemas
const groupSchema = {
type: "object",
properties: {
groups: {
type: "array",
minItems: 0,
maxItems: 5,
uniqueItems: true,
items: {
type: "object",
properties: {
id: {
type: "string",
faker: "random.uuid"
},
name: {
type: "string",
faker: "commerce.productName"
}
},
required: ["id", "name"]
}
}
},
required: ["groups"]
};
export default groupSchema;
const siteSchema = {
type: "object",
properties: {
sites: {
type: "array",
minItems: 0,
maxItems: 20,
uniqueItems: true,
items: {
type: "object",
properties: {
id: {
type: "string",
faker: "random.uuid"
},
name: {
type: "string",
faker: "internet.domainName"
},
url: {
type: "string",
faker: "internet.url"
},
userName: {
type: "string",
faker: "internet.email"
},
password: {
type: "string",
faker: "internet.password"
}
},
required: ["id", "name", "url", "userName", "password"]
}
}
},
required: ["sites"]
};
export default siteSchema;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment