Tutorial Some Examples of JSON - Gnorion/BizVR GitHub Wiki
Tutorial Some Examples of JSON
You can copy/paste this JSON if you need it in order to execute the tutorial examples.
Tutorial 1: Three unrelated properties (color, size and shape)
{ "color":"red","size":"small","shape":"square"}
Tutorial 2: single object named "toy" with three properties
{ "toy":
{
"color": "red",
"size": "small",
"shape": "square"
}
}
A collection (named TOYS) consisting of one or more toy (as defined above)
Note the name "toy" does not appear in the json, just the name of the collection (TOYS)
{
"TOYS":[
{"color": "red", "shape": "square","size": "small"},
{"color": "green","shape": "square","size": "large"},
{"color": "blue", "shape": "round", "size": "large"}
]
}
A collection named CHILDREN each of which has a name and a collection of TOYS
{"CHILDREN":[
{"name":"billy",
"TOYS":[{"type":"train","color":"red"},
{"type":"teddy bear","color":"brown"}]
},
{"name":"mary",
"TOYS":[{"type":"bicycle","color":"blue"},
{"type":"roller skates","color":"pink"}]
}
]
}
A Collection of colors
{"COLORS":["red","green","blue","yellow","orange"]}
A Collection of the nine digits from 1 thru 9
{"DIGITS":[1,2,3,4,5,6,7,8,9]}
Santa's Reindeer
{
"REINDEER":[
{"name":"Blitzen","gender":"male"},
{"name":"Dasher", "gender":"female"},
{"name":"Rudolph","gender":"male"},
{"name":"Cupid", "gender":"male"},
{"name":"Prancer","gender":"male"},
{"name":"Vixen", "gender":"female"},
{"name":"Comet", "gender":"male"},
{"name":"Donder", "gender":"male"},
{"name":"Dancer", "gender":"female"}
]
}
A Collection of PERSONS
{"PERSONS":[
{"name":"tom","gender":"m","hobby":"skydiving","zip":"12345","available":"yes"},
{"name":"mary","gender":"f","hobby":"skydiving","zip":"12345","available":"yes"},
{"name":"jill","gender":"f","hobby":"skydiving","zip":"12345","available":"yes"},
{"name":"john","gender":"m","hobby":"skydiving","zip":"12345","available":"yes"}
]
}
CUSTOMERS, ORDERS and ITEMS
{"CUSTOMERS":[
{"type":"retail","name":"smith","customer number":"A123456",
"ORDERS":[
{"method":"online","order number":"A1",
"ITEMS":[{"sku":"1108","qty":5},
{"sku":"2639","qty":5}]},
{"method":"online","order number":"A2",
"ITEMS":[{"sku":"5508","qty":1},
{"sku":"2639","qty":2}]}
]},
{"type":"retail","name":"jones",,"customer number":"B987654",
"ORDERS":[
{"method":"online","order number":"B1",
"ITEMS":[{"sku":"1108","qty":3},
{"sku":"2639","qty":3}]},
{"method":"online","order number":"B2",
"ITEMS":[{"sku":"5508","qty":4},
{"sku":"2639","qty":1}]}
]}
]}