Skip to content

Instantly share code, notes, and snippets.

@dacioromero
Last active March 8, 2019 14:14
Show Gist options
  • Save dacioromero/be244500ee372fdf93c1a6073bdc46a9 to your computer and use it in GitHub Desktop.
Save dacioromero/be244500ee372fdf93c1a6073bdc46a9 to your computer and use it in GitHub Desktop.
Validated User JSON Schema for https://medium.com/p/71e0ebb840ae
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "User",
"description": "A user in the database",
"type": "object",
"properties": {
"email": {
"description": "Their email",
"type": "string",
"format": "email"
},
"username": {
"description": "Their username",
"type": "string",
"minLength": 4,
"maxLength": 32
},
"password": {
"description": "Their password",
"type": "string",
"minLength": 16
},
"age": {
"description": "Their age",
"type": "integer",
"minimum": 0
}
},
"required": ["email", "username", "password", "age"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment