Skip to content

Instantly share code, notes, and snippets.

@gilesbowkett
Created January 15, 2015 21:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gilesbowkett/bbebc6834935dd8d4af1 to your computer and use it in GitHub Desktop.
Save gilesbowkett/bbebc6834935dd8d4af1 to your computer and use it in GitHub Desktop.
var schema = Joi.object().keys({
username: Joi.string().alphanum().min(3).max(30).required(),
password: Joi.string().regex(/[a-zA-Z0-9]{3,30}/),
access_token: [Joi.string(), Joi.number()],
birthyear: Joi.number().integer().min(1900).max(2013),
email: Joi.string().email()
}).with('username', 'birthyear').without('password', 'access_token');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment