Skip to content

Instantly share code, notes, and snippets.

@deoxxa
Created September 8, 2011 08:46
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 deoxxa/6e7a26106e06bf540999 to your computer and use it in GitHub Desktop.
Save deoxxa/6e7a26106e06bf540999 to your computer and use it in GitHub Desktop.
JSON Schema Example
{
"id": 1,
"title": "Hello, World!",
"content": "This is a sample blog post.",
"tags": ["sample", "hello world"],
"comments": [
{"name": "User A", "email": "user.a@example.com", "time": "Sat Jul 02 2011 12:43:21 GMT+1000 (EST)", "comment": "Great post!"},
{"name": "User B", "email": "user.b@example.com", "time": "Sat Jul 02 2011 11:45:47 GMT+900 (JST)", "comment": "I agree with User A"}
]
}
"blog_post": {
"type": ["hash"],
"children": {
"id": {
"type": ["numeric"]
},
"title": {
"type": ["text","text_extended"],
"attributes": {
"text_extended_max_length": 120
}
},
"content": {
"type": ["text"]
},
"tags": {
"type": ["list"],
"items": {
"type": ["text","text_extended"],
"attributes": {
"text_extended_max_length": 30
}
}
},
"comments": {
"type": ["list"],
"items": {
"type": ["hash"],
"children": {
"name": {
"type": ["text","text_extended"],
"attributes": {
"text_extended_max_length": 40
}
},
"email": {
"type": ["text","text_extended"],
"attributes": {
"text_extended_max_length": 100
}
},
"time": {
"type": ["text","text_timestamp"]
},
"comment": {
"type": ["text","text_extended"],
"attributes": {
"text_extended_max_length": 10000
}
}
}
}
}
}
}
@1cg
Copy link

1cg commented Sep 8, 2011 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment