Sky Sky - 1 month ago 23
JSON Question

different types of JSON

I was looking at this question

What is JSON and why would I use it?

I am confused between different names given to JSON structures


  • What is a simple JSON ?

  • array of JSON ?

  • array of JSON array ?

  • others possible any



Example 1 : what is this called

{
"MIT_COLLEGE": [
{
"_id": 1,
"StudentName": "Sam",
"Student_Age": "24",
"Student_phone": "8725436232",
"Student_sex": "Male",
},
{
"_id": 2,
"StudentName": "kira",
"Student_Age": "22",
"Student_phone": "8725136232",
"Student_sex": "Female",
}
],
"CAMBRIDGE_COLLEGE": [
{
"_id": 1,
"StudentName": "Paul",
"Student_Age": "26",
"Student_phone": "87333336232",
"Student_sex": "Male",
},
{
"_id": 2,
"StudentName": "michael",
"Student_Age": "22",
"Student_phone": "872115436232",
"Student_sex": "Male",
}
]
}


Example 2:: what is this called

{
"_id": 2,
"StudentName": "michael",
"Student_Age": "22",
"Student_phone": "872115436232",
"Student_sex": "Male",
}


Other possible structures in JSON and what is it called ?

Thanks ... hope i am clear

Answer

JSON is JSON.

Douglas Crockford says it best:

http://www.json.org/fatfree.html

JSON (or JavaScript Object Notation) is a programming language model data interchange format. It is minimal, textual, and a subset of JavaScript. Specifically, it is a subset of ECMA-262 (The ECMAScript programming Language Standard, Third Edition, December 1999). It is lightweight and very easy to parse.

JSON is not a document format. It is not a markup language. It is not even a general serialization format in that it does not have a direct representation for cyclical structures, although it can support a meta representation that does. ...

With no other effort on my part, JSON has been widely adopted by people who found that it made it a lot easier to produce distributed applications and services. The original page has been translated into Chinese, French, German, Italian, Japanese, Korean, and Spanish. JSON has been formalized in RFC 4627. The MIME Media Type is application/json.

The types represented in JSON are strings, numbers, booleans, object, arrays, and null.

It's really no more, and no less, than a few specific constructs from the Javascript programming language. Those constructs (as stated above) are ONLY the following:

  • string
  • number
  • boolean
  • object
  • arrays
  • null

Both examples you cited above are simply "JSON".

You can find out more here: