JSON : basic introduction and references

                                                                               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.

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]
Key and value are separated by colon “:”
Sample json file –  (format – *.json) 

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

Now a days most server responses comes with json format upon web application request, we can write programe to read the json data and can validate the details……

So coming to testing, we can use json data as our test data or we can keep configuration details in JSON format.

Content posted is based on learning or working experience, Share the post with others if find useful, Any queries?, leave comments or discuss on our facebook:qavalidation.com, Thanks!

Leave a Reply

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

%d bloggers like this: