JSON
What is JSON
JSON Syntax
JSON Datatypes
JSON Schema
What is JSON
• JSON is a data interchange format
• A data interchange format is a text format used to exchange data between platforms.
• Another data interchange format you may already have heard of is XML.
• The world needs data interchange formats, like XML and JSON, to exchange data between very
different systems.
• JSON Is Programming Language Independent
• Portability, or the compatibility in transferring information between platforms and
systems, is the very goal of a data interchange format.
• Not only is JSON language independent, it represents data in a way that speaks to
common elements of many programming languages.
• With the way that data is represented, such as numbers and words, even the
programming languages that aren’t object-oriented can find this format acceptable.
Key Terms and Concepts
key terms:
JSON  JavaScript Object Notation
Notation A system of characters for representing data such as numbers or elements
Data interchange format Text used to exchange data between platforms or systems
Portability Transferring information between platforms in a way that is compatible
with both systems
The key concepts:
• JSON is a data interchange format
• JSON is programming language independent (JavaScript is not required to use it)
• JSON is based on the object literal notation of JavaScript (emphasis on the word
“notation”)
• JSON represents data in a way that is friendly to universal programming concepts
JSON Is Based on JavaScript Object Literals
• In programming, the word “literal” is a noun. A literal is a value that is represented
literally with data. It is written precisely as it is meant to be interpreted.
• In programming, we often use variables to represent values. For example, I might use
a variable I call x in an expression like:
x = 5
Then, later on, I might want to add five more to x:
x = x + 5
• At this point, the value of x is 10, but we don’t see 10. In this example, x was the
variable, and 5 was a literal.
• In the "x = 5” example, 5 is a number literal. A number is a data type. Other types of
data are strings (made up of characters), Boolean (true or false), null (nothing),
collections of values, and objects
JSON Is Based on JavaScript Object Literals
• The way that JSON is based on JavaScript object literals is purely in the syntactic
representation of the object literal and its properties.
• This representation of properties is achieved with name-value pairs.
Name-Value Pairs
• The concept of name-value pairs is widespread in computing.
• They are called by other names as well:
• key-value pairs,
• attribute-value pairs, and
• field-value pairs.
Name-value pair
In a name-value pair, Pair implies two things: a name and a value.
With name-value pairs in JSON, the value can also be a number, a boolean, null, an array,
or an object.if, you first declare the name, then give the name, a value.
"animal" : "cat"
“animal” is the name and “cat” is the value
Rules:
• Both Name and value must be put under double Quotes
• JSON accepts spaces and special characters in the name but it is always consider
better
• Eg: {"Lindsay's animal": "cat”} {"lindsaysAnimal": "cat“}
{ "My animal": "cat“} {"myAnimal": "cat“}
• JSON uses colon (: ) as a separator to separate Name and value
• JSON uses comma(,) as a separator to separate multiple name-value pairs
• Eg: { "animal" : "cat", "color" : "orange" }
JSON SYNTAX
• { (left curly bracket) says “begin object”
• } (right curly bracket) says “end object”
• [ (left square bracket) says “begin array”
• ] (right square bracket) says “end array”
• : (colon) says “separating a name and a value in a name-value pair”
• , (comma) says “separating a name-value pair in an object” or “separating a value in an array”;
------------------------------------------
{
title : "This is my title.",
body : "This is the body."
}
----------------------------------
{
'title': 'This is my title.',
'body': 'This is the body.'
}
Syntax Validation
• JSON Formatter & ValidatorA formatting tool with options, and a beautiful UI that
highlights errors. The processed JSON displays in a window that doubles as a tree/node
style visualization tool and a window to copy/paste your formatted code from
• JSON Editor OnlineAn all-in-one validation, formatting, and visualization tool for JSON. An
error indicator is displayed on the line of the error. Upon validation, helpful parsing error
information is displayed. The visualization tool displays your JSON in a tree/node format
• JSONLintA no-bells-and-whistles validation tool for JSON. Simply copy, paste, and click
“validate.” It also kindly formats your JSON
JSON as a Document
• JSON can be its own document and live in a filesystem.
• The file extension for JSON is easy to remember: .json.
• So, if one needs to save the file named animals JSON to a file and store it on the computer, it
would look something like this: C:animals.json
The JSON MediaType
• Oftentimes when you are passing data to someone else, you need to tell them ahead of time
what type it is. You may hear this called an Internet media type, a content type, or a MIME
type.
• This type is formatted as “type/subtype.” One type that you may have already heard of is
“text/html.”
• The MIME type for JSON is application/json.
• The Internet Assigned Numbers Authority (IANA) maintains a comprehensive list of media
types.
JSON Data Types
The JSON data types are:
• Object
• String
• Number
• Boolean
• Null
• Array
Primitive data types:
• Numbers (e.g., 5 or 5.09)
— Integer
— Floating-point number
— Fixed-point number
• Characters and strings (e.g., “a” or “A” or “apple”)
• Booleans (i.e., true or false)
JSON Object Data Types
The JSON object data type is simple. JSON, at its root, is an object. It is a list of name-value
pairs surrounded in curly braces
<!DOCTYPE html>
<html>
<head>
<title> JSON Example</title>
</head>
<body>
<script type="text/javascript">
let emp=`[
{"name":"Linda",
"Age":"23"
}
]`
console.log(JSON.parse(emp)[0].name)
</script>
</body>
</html>
JSON Is Based on JavaScript Object Literals
{
"promo": "Say "Bob's the best!" at checkout for free 8oz bag of kibble."
}
---------------------------------------------------------------------------------------------------
{
"promo": "Say "Bob's the best!" at checkout for free 8oz bag of kibble."
}
This backslash character will tell the parser that the quote is not the end of the string.
Name
value
Quoted information
within the value

More Related Content

PPTX
PPTX
JSON - (English)
PPTX
Json training
PPT
PPTX
Introduction to JavaScript Object Notation(JSON)
PPTX
All about XML, JSON and related topics..
PPT
java script json
JSON - (English)
Json training
Introduction to JavaScript Object Notation(JSON)
All about XML, JSON and related topics..
java script json

Similar to JSON.pptx (20)

PPTX
1 Json Intro and datatype PRESENTATION.pptx
PPTX
Unit-2.pptx
PPT
json.ppt download for free for college project
PPT
JSON - Quick Overview
PPTX
LU 1.3. JSON & XML.pptx about how they work and introduction
PDF
CS8651 IP Unit 2 pdf regulation -2017 anna university
PPTX
json.pptx
PPTX
Java script and json
PPTX
Json
PDF
Json tutorial
PDF
Json
PPTX
unit5_part2.pptx
PDF
Introduction to JSON
PPT
Json – java script object notation
PPT
Java Script Object Notation (JSON)
PDF
Intro to JSON
PPTX
Intro to JSON
PDF
Json demo
1 Json Intro and datatype PRESENTATION.pptx
Unit-2.pptx
json.ppt download for free for college project
JSON - Quick Overview
LU 1.3. JSON & XML.pptx about how they work and introduction
CS8651 IP Unit 2 pdf regulation -2017 anna university
json.pptx
Java script and json
Json
Json tutorial
Json
unit5_part2.pptx
Introduction to JSON
Json – java script object notation
Java Script Object Notation (JSON)
Intro to JSON
Intro to JSON
Json demo
Ad

Recently uploaded (20)

PPTX
BSCE 2 NIGHT (CHAPTER 2) just cases.pptx
PPTX
2025 High Blood Pressure Guideline Slide Set.pptx
PDF
Controlled Drug Delivery System-NDDS UNIT-1 B.Pharm 7th sem
PDF
MICROENCAPSULATION_NDDS_BPHARMACY__SEM VII_PCI Syllabus.pdf
PDF
Farming Based Livelihood Systems English Notes
PPTX
Climate Change and Its Global Impact.pptx
PDF
Skin Care and Cosmetic Ingredients Dictionary ( PDFDrive ).pdf
PDF
Solved Past paper of Pediatric Health Nursing PHN BS Nursing 5th Semester
PPTX
What’s under the hood: Parsing standardized learning content for AI
PPTX
CAPACITY BUILDING PROGRAMME IN ADOLESCENT EDUCATION
PDF
1.Salivary gland disease.pdf 3.Bleeding and Clotting Disorders.pdf important
PDF
Journal of Dental Science - UDMY (2020).pdf
PDF
Nurlina - Urban Planner Portfolio (english ver)
PDF
THE CHILD AND ADOLESCENT LEARNERS & LEARNING PRINCIPLES
PDF
Literature_Review_methods_ BRACU_MKT426 course material
PDF
Civil Department's presentation Your score increases as you pick a category
DOCX
Cambridge-Practice-Tests-for-IELTS-12.docx
PDF
M.Tech in Aerospace Engineering | BIT Mesra
PDF
semiconductor packaging in vlsi design fab
PDF
LIFE & LIVING TRILOGY- PART (1) WHO ARE WE.pdf
BSCE 2 NIGHT (CHAPTER 2) just cases.pptx
2025 High Blood Pressure Guideline Slide Set.pptx
Controlled Drug Delivery System-NDDS UNIT-1 B.Pharm 7th sem
MICROENCAPSULATION_NDDS_BPHARMACY__SEM VII_PCI Syllabus.pdf
Farming Based Livelihood Systems English Notes
Climate Change and Its Global Impact.pptx
Skin Care and Cosmetic Ingredients Dictionary ( PDFDrive ).pdf
Solved Past paper of Pediatric Health Nursing PHN BS Nursing 5th Semester
What’s under the hood: Parsing standardized learning content for AI
CAPACITY BUILDING PROGRAMME IN ADOLESCENT EDUCATION
1.Salivary gland disease.pdf 3.Bleeding and Clotting Disorders.pdf important
Journal of Dental Science - UDMY (2020).pdf
Nurlina - Urban Planner Portfolio (english ver)
THE CHILD AND ADOLESCENT LEARNERS & LEARNING PRINCIPLES
Literature_Review_methods_ BRACU_MKT426 course material
Civil Department's presentation Your score increases as you pick a category
Cambridge-Practice-Tests-for-IELTS-12.docx
M.Tech in Aerospace Engineering | BIT Mesra
semiconductor packaging in vlsi design fab
LIFE & LIVING TRILOGY- PART (1) WHO ARE WE.pdf
Ad

JSON.pptx

  • 1. JSON What is JSON JSON Syntax JSON Datatypes JSON Schema
  • 2. What is JSON • JSON is a data interchange format • A data interchange format is a text format used to exchange data between platforms. • Another data interchange format you may already have heard of is XML. • The world needs data interchange formats, like XML and JSON, to exchange data between very different systems. • JSON Is Programming Language Independent • Portability, or the compatibility in transferring information between platforms and systems, is the very goal of a data interchange format. • Not only is JSON language independent, it represents data in a way that speaks to common elements of many programming languages. • With the way that data is represented, such as numbers and words, even the programming languages that aren’t object-oriented can find this format acceptable.
  • 3. Key Terms and Concepts key terms: JSON  JavaScript Object Notation Notation A system of characters for representing data such as numbers or elements Data interchange format Text used to exchange data between platforms or systems Portability Transferring information between platforms in a way that is compatible with both systems The key concepts: • JSON is a data interchange format • JSON is programming language independent (JavaScript is not required to use it) • JSON is based on the object literal notation of JavaScript (emphasis on the word “notation”) • JSON represents data in a way that is friendly to universal programming concepts
  • 4. JSON Is Based on JavaScript Object Literals • In programming, the word “literal” is a noun. A literal is a value that is represented literally with data. It is written precisely as it is meant to be interpreted. • In programming, we often use variables to represent values. For example, I might use a variable I call x in an expression like: x = 5 Then, later on, I might want to add five more to x: x = x + 5 • At this point, the value of x is 10, but we don’t see 10. In this example, x was the variable, and 5 was a literal. • In the "x = 5” example, 5 is a number literal. A number is a data type. Other types of data are strings (made up of characters), Boolean (true or false), null (nothing), collections of values, and objects
  • 5. JSON Is Based on JavaScript Object Literals • The way that JSON is based on JavaScript object literals is purely in the syntactic representation of the object literal and its properties. • This representation of properties is achieved with name-value pairs. Name-Value Pairs • The concept of name-value pairs is widespread in computing. • They are called by other names as well: • key-value pairs, • attribute-value pairs, and • field-value pairs.
  • 6. Name-value pair In a name-value pair, Pair implies two things: a name and a value. With name-value pairs in JSON, the value can also be a number, a boolean, null, an array, or an object.if, you first declare the name, then give the name, a value. "animal" : "cat" “animal” is the name and “cat” is the value Rules: • Both Name and value must be put under double Quotes • JSON accepts spaces and special characters in the name but it is always consider better • Eg: {"Lindsay's animal": "cat”} {"lindsaysAnimal": "cat“} { "My animal": "cat“} {"myAnimal": "cat“} • JSON uses colon (: ) as a separator to separate Name and value • JSON uses comma(,) as a separator to separate multiple name-value pairs • Eg: { "animal" : "cat", "color" : "orange" }
  • 7. JSON SYNTAX • { (left curly bracket) says “begin object” • } (right curly bracket) says “end object” • [ (left square bracket) says “begin array” • ] (right square bracket) says “end array” • : (colon) says “separating a name and a value in a name-value pair” • , (comma) says “separating a name-value pair in an object” or “separating a value in an array”; ------------------------------------------ { title : "This is my title.", body : "This is the body." } ---------------------------------- { 'title': 'This is my title.', 'body': 'This is the body.' }
  • 8. Syntax Validation • JSON Formatter & ValidatorA formatting tool with options, and a beautiful UI that highlights errors. The processed JSON displays in a window that doubles as a tree/node style visualization tool and a window to copy/paste your formatted code from • JSON Editor OnlineAn all-in-one validation, formatting, and visualization tool for JSON. An error indicator is displayed on the line of the error. Upon validation, helpful parsing error information is displayed. The visualization tool displays your JSON in a tree/node format • JSONLintA no-bells-and-whistles validation tool for JSON. Simply copy, paste, and click “validate.” It also kindly formats your JSON
  • 9. JSON as a Document • JSON can be its own document and live in a filesystem. • The file extension for JSON is easy to remember: .json. • So, if one needs to save the file named animals JSON to a file and store it on the computer, it would look something like this: C:animals.json The JSON MediaType • Oftentimes when you are passing data to someone else, you need to tell them ahead of time what type it is. You may hear this called an Internet media type, a content type, or a MIME type. • This type is formatted as “type/subtype.” One type that you may have already heard of is “text/html.” • The MIME type for JSON is application/json. • The Internet Assigned Numbers Authority (IANA) maintains a comprehensive list of media types.
  • 10. JSON Data Types The JSON data types are: • Object • String • Number • Boolean • Null • Array Primitive data types: • Numbers (e.g., 5 or 5.09) — Integer — Floating-point number — Fixed-point number • Characters and strings (e.g., “a” or “A” or “apple”) • Booleans (i.e., true or false)
  • 11. JSON Object Data Types The JSON object data type is simple. JSON, at its root, is an object. It is a list of name-value pairs surrounded in curly braces <!DOCTYPE html> <html> <head> <title> JSON Example</title> </head> <body> <script type="text/javascript"> let emp=`[ {"name":"Linda", "Age":"23" } ]` console.log(JSON.parse(emp)[0].name) </script> </body> </html>
  • 12. JSON Is Based on JavaScript Object Literals { "promo": "Say "Bob's the best!" at checkout for free 8oz bag of kibble." } --------------------------------------------------------------------------------------------------- { "promo": "Say "Bob's the best!" at checkout for free 8oz bag of kibble." } This backslash character will tell the parser that the quote is not the end of the string. Name value Quoted information within the value