What is JSON
Jun 11, 2020
Make sure to subscribe to our newsletter and be the first to know the news.
Jun 11, 2020
Make sure to subscribe to our newsletter and be the first to know the news.
JSON stands for JavaScript Object Notation.
Official definition/ explanation for JSON is given as
Based upon the discussion, I would like it to relate that JSON is one of the most used data interchange language, for example if you want a Microservice built in Java to talk with another Microservice built in Node.JS, they can connect with each other using JSON.
JSON is a mediator language like your expression, no matter if you speak English, French, German, Arabic or Japanese the thing is if you are smiling you are happy and if you are crying you are sad. Irrespective of your language, anywhere in the world any one can detect if you are sad or happy.
A JSON Object is a combination of name value pairs which are separated by a colon (:) and engulfed inside a pair of curly braces {} .
A name in key value pair is always a String, but a value can be of possible types.
{
"name":"Sachin Tendulkar",
"country":"India",
"centuries" :100
}
Above described is a simple JSON Object only containing the key value pairs.
{
"empId":1000,
"name":"Tom",
"dept":"IT",
"project":{
"name":"Big Data Analysis of Covid Data",
"manager":"Alex"
},
"salary":34098.88
}
Above described is a simple JSON Object containing another JSON Object by name of project inside it.
{
"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" }
]
}
In the example JSON above, we can see that a JSON Object is encompassed inside a pair of curly braces and it contain
a String Value in form of firstName
a JSON Object in form of address (which further contains another key value pairs inside it)
an array in form of phoneNumber.