json
 

JavaScript Object Notation

 

Used as a lightweight data sharing format in between server and web application, and also in between web applications.


  • This is called as fat-free version of XML :D.
  • Easy read / write format.
  • A collection of “key” : “value” pairs.
  • This can be represented as object, dictionary, hash table, keyed list or associated arrays.
  • Key and value are separated by colon “:”
  • JSON file extension is .json

 

As compare to XML, json

  • Don’t have tags, but have hierarchy structure with some easy notations.
  • Can’t use javascript keywords as names.
  • Can be parsed easily.

 

Notations

Key can be of any name [String] enclosed in double quotes “”

Value can be represented as any one of the following data type like Associated arrays enclosed in square brackets []

either key : value pairs or only values separated by comma “,” can be from any one of the

  • Collection [array/list/map]
  • Boolean [true / false]
  • Number [Int]
  • Object
  • String [Plain text]

 

Sample json – 

{
	"qavalidation.com": 
	[
		{
			"Course": "Selenium",
			"Category": 
			[
				"youtube", "blog"
			],
			"isWeb": true
		},
		{
			"Course": "Appium",
			"Category": 
			[
				"youtube", "blog"
			],
			"isWeb": false
		}
	]
}
JSON uses javascript, but any programming language can read json data as this is text only format.

 

JSON viewer:

References:

For pictorial representation, refer official site http://www.json.org/
For more detailed explanation, refer http://www.w3schools.com/json

Leave a Reply

Your email address will not be published. Required fields are marked *

Post comment