Add a few more json samples

This commit is contained in:
Joshua Peek
2012-07-24 11:12:33 -05:00
parent 9777798cf7
commit be1340bafc
4 changed files with 88 additions and 9 deletions

23
samples/JSON/person.json Normal file
View File

@@ -0,0 +1,23 @@
{
"firstName": "John",
"lastName" : "Smith",
"age" : 25,
"address" :
{
"streetAddress": "21 2nd Street",
"city" : "New York",
"state" : "NY",
"postalCode" : "10021"
},
"phoneNumber":
[
{
"type" : "home",
"number": "212 555-1234"
},
{
"type" : "fax",
"number": "646 555-4567"
}
]
}

View File

@@ -0,0 +1,7 @@
{
"id": 1,
"name": "Foo",
"price": 123,
"tags": ["Bar","Eek"],
"stock": { "warehouse":300, "retail":20 }
}

47
samples/JSON/schema.json Normal file
View File

@@ -0,0 +1,47 @@
{
"name":"Product",
"properties":
{
"id":
{
"type":"number",
"description":"Product identifier",
"required":true
},
"name":
{
"type":"string",
"description":"Name of the product",
"required":true
},
"price":
{
"type":"number",
"minimum":0,
"required":true
},
"tags":
{
"type":"array",
"items":
{
"type":"string"
}
},
"stock":
{
"type":"object",
"properties":
{
"warehouse":
{
"type":"number"
},
"retail":
{
"type":"number"
}
}
}
}
}