Skip to content

Instantly share code, notes, and snippets.

@HonzaMac
Last active December 30, 2021 23:21
Show Gist options
  • Save HonzaMac/3a8226e02c9834d38ccd9d3f6a8fbf2e to your computer and use it in GitHub Desktop.
Save HonzaMac/3a8226e02c9834d38ccd9d3f6a8fbf2e to your computer and use it in GitHub Desktop.
user entity in yup schema
import { object, string } from "yup"
export const userSchema = object({
id: string().uuid(),
username: string().required(),
email: string().email().required(),
country: string().required(),
department: string().required(),
divisionName: string().required(),
city: string().optional(),
}).required();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment