What are the syntax rules for JSON data?

JSON syntax is derived from javascript syntax.

JSON Syntax:

  • Data must be in name: value pairs
  • Data must be separated by commas
  • Objects are held between curly braces.
  • Arrays are held between square brackets.
  • File type for JSON file is ‘.json’
  • MIME type for JSON text is ‘application/json’

In JSON, the values must be of any one of the following types:

  • String (must be written in double quotes)
  • Number (Integer or float)
  • Object
  • Array
  • Boolean
  • Null

What is JSON?

JSONĀ stands for JavaScript Object Notation. JSON is a text syntax for storing and exchanging data between servers and browsers. As it is in text format, it is language independent.

Example:

{ “studentDetails” : {

“name” : “Jenilia”,

“id” : 1000234,

“specialization” : “Robotics”

}

}