Skip to content

Instantly share code, notes, and snippets.

@dacioromero
Last active March 8, 2019 14:27
Show Gist options
  • Save dacioromero/664fc3516a17c725f7ad38bbc3c63d72 to your computer and use it in GitHub Desktop.
Save dacioromero/664fc3516a17c725f7ad38bbc3c63d72 to your computer and use it in GitHub Desktop.
Reddit Post Schema for https://medium.com/p/71e0ebb840ae
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Post",
"description": "A Reddit post and its comments",
"type": "object",
"properties": {
"title": {
"type": "string",
"minLength": 8,
"maxLength": 32
},
"content": {
"anyOf": [
{
"type": "string",
"format": "uri",
"pattern": "^https?://"
},
{
"type": "string",
"minLength": 16
}
]
},
"votes": {
"type": "object",
"properties": {
"up": {
"type": "integer",
"minimum": 0
},
"down": {
"type": "integer",
"minimum": 0
}
}
}
},
"required": ["title", "content"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment