SlideShare a Scribd company logo
JSON
Viewer
Dhaval Dalal
https://dhavaldalal.wordpress.com
@softwareartisan
Story #1: View Raw Content
As a developer,
I want to see all the lines of a JSON text
file as-is when I specify on command
line,
$> prettyjson -r responses.json
So that I can know its contents.
Story #2: View raw content
with Line Numbers
As a developer,
I want to see all the lines of a JSON text
file with line numbers when I specify on
command line,
$> prettyjson -l responses.json
So that I can refer to lines with line
numbers.
Story #3: Show
Pretty JSON
As a developer
I want to see the JSON text file
in a pretty format with
indentation
$> prettyjson response.json
So that I can clearly see the
keys and their corresponding
values.
[
{
"ticker": "AAPL",
"high": 60.45,
"tickMillis": {
"high": 3000,
"low": 2000
},
"low": 50.35,
"price": 53.2,
"name": "Apple Inc."
},
{
"ticker": "GOOG",
"high": 120.34,
"tickMillis": {
"high": 2000,
"low": 1000
},
"low": 90.67,
"price": 97.28,
"name": "Google Inc."
}
]
Story #4: Pretty
JSON with Line #s
As a developer
I want to see the JSON text
file in a pretty format along
with indentation and line
numbers as shown
$> prettyjson -l response.json
So that I can also refer data
using line numbers.
1 [
2 {
3 "ticker": "AAPL",
4 "high": 60.45,
5 "tickMillis": {
6 "high": 3000,
7 "low": 2000
8 },
9 "low": 50.35,
10 "price": 53.2,
11 "name": "Apple Inc."
12 },
13 {
14 "ticker": "GOOG",
15 "high": 120.34,
16 "tickMillis": {
17 "high": 2000,
18 "low": 1000
19 },
20 "low": 90.67,
21 "price": 97.28,
22 "name": "Google Inc."
23 }
24 ]
Story #5: Pygmentized JSON
As a developer
I want to see the JSON text
file in a pretty format along
with colours as shown
$> prettyjson response.json
So that I can recognise keys
are blue, numbers are in
yellow and strings are in
green colour.
NOTE: this command conflicts
with Story #3. So, we introduce
another option “nc” to produce
monochrome (not colored)
output. This will not break
Story #3.
$> prettyjson -nc response.json
Story #5:
Pygmentized JSON
[
{
"ticker": "AAPL",
"high": 60.45,
"tickMillis": {
"high": 3000,
"low": 2000
},
"low": 50.35,
"price": 53.2,
"name": "Apple Inc."
},
{
"ticker": "GOOG",
"high": 120.34,
"tickMillis": {
"high": 2000,
"low": 1000
},
"low": 90.67,
"price": 97.28,
"name": "Google Inc."
}
]
Story #6: Pygmentized JSON
with Line numbers
As a developer
I want to see the JSON text file
in a pretty format along with
lines numbers in colour and
colours as shown
$> prettyjson -l response.json
So that I can recognise keys are
blue, numbers are in yellow
and strings are in green colour.
Story #7: View Raw with all
possible options
I want to see the JSON text file in a raw format
with or without lines numbers, with to without
colours
$> prettyjson -l -r response.json
$> prettyjson -r response.json
$> prettyjson -l -r -nc response.json (same output as story#2)
Thank-you!

More Related Content

Similar to Json Viewer Stories

Similar to Json Viewer Stories (20)

UKOUG Tech14 - Getting Started With JSON in the Database
UKOUG Tech14 - Getting Started With JSON in the DatabaseUKOUG Tech14 - Getting Started With JSON in the Database
UKOUG Tech14 - Getting Started With JSON in the Database
 
Json
JsonJson
Json
 
How to leverage what's new in MongoDB 3.6
How to leverage what's new in MongoDB 3.6How to leverage what's new in MongoDB 3.6
How to leverage what's new in MongoDB 3.6
 
Mongo db mug_2012-02-07
Mongo db mug_2012-02-07Mongo db mug_2012-02-07
Mongo db mug_2012-02-07
 
Starting with JSON Path Expressions in Oracle 12.1.0.2
Starting with JSON Path Expressions in Oracle 12.1.0.2Starting with JSON Path Expressions in Oracle 12.1.0.2
Starting with JSON Path Expressions in Oracle 12.1.0.2
 
Oracle Database - JSON and the In-Memory Database
Oracle Database - JSON and the In-Memory DatabaseOracle Database - JSON and the In-Memory Database
Oracle Database - JSON and the In-Memory Database
 
Wie man Datenbankinfrastrukturen in Containern zum Laufen bringt
Wie man Datenbankinfrastrukturen in Containern zum Laufen bringtWie man Datenbankinfrastrukturen in Containern zum Laufen bringt
Wie man Datenbankinfrastrukturen in Containern zum Laufen bringt
 
How to Leverage APIs for SEO #TTTLive2019
How to Leverage APIs for SEO #TTTLive2019How to Leverage APIs for SEO #TTTLive2019
How to Leverage APIs for SEO #TTTLive2019
 
eMan Dev Meetup: Kotlin For Android (part 03/03) 18.5.2017
eMan Dev Meetup: Kotlin For Android (part 03/03) 18.5.2017eMan Dev Meetup: Kotlin For Android (part 03/03) 18.5.2017
eMan Dev Meetup: Kotlin For Android (part 03/03) 18.5.2017
 
Somewhere between schema and schemaless
Somewhere between schema and schemalessSomewhere between schema and schemaless
Somewhere between schema and schemaless
 
M|18 Somewhere Between Schema and Schemaless
M|18 Somewhere Between Schema and SchemalessM|18 Somewhere Between Schema and Schemaless
M|18 Somewhere Between Schema and Schemaless
 
"R, HTTP, and APIs, with a preview of TopicWatchr" (15 November 2011)
"R, HTTP, and APIs, with a preview of TopicWatchr" (15 November 2011)"R, HTTP, and APIs, with a preview of TopicWatchr" (15 November 2011)
"R, HTTP, and APIs, with a preview of TopicWatchr" (15 November 2011)
 
R, HTTP, and APIs, with a preview of TopicWatchr
R, HTTP, and APIs, with a preview of TopicWatchrR, HTTP, and APIs, with a preview of TopicWatchr
R, HTTP, and APIs, with a preview of TopicWatchr
 
Compose Code Camp (1).pptx
Compose Code Camp (1).pptxCompose Code Camp (1).pptx
Compose Code Camp (1).pptx
 
JSON Support in DB2 for z/OS
JSON Support in DB2 for z/OSJSON Support in DB2 for z/OS
JSON Support in DB2 for z/OS
 
The Ring programming language version 1.5.2 book - Part 14 of 181
The Ring programming language version 1.5.2 book - Part 14 of 181The Ring programming language version 1.5.2 book - Part 14 of 181
The Ring programming language version 1.5.2 book - Part 14 of 181
 
Advanced Json
Advanced JsonAdvanced Json
Advanced Json
 
MongoDB
MongoDB MongoDB
MongoDB
 
The Ring programming language version 1.5 book - Part 3 of 31
The Ring programming language version 1.5 book - Part 3 of 31The Ring programming language version 1.5 book - Part 3 of 31
The Ring programming language version 1.5 book - Part 3 of 31
 
Practical Ruby Projects With Mongo Db
Practical Ruby Projects With Mongo DbPractical Ruby Projects With Mongo Db
Practical Ruby Projects With Mongo Db
 

More from Dhaval Dalal

More from Dhaval Dalal (20)

Test Pyramid in Microservices Context
Test Pyramid in Microservices ContextTest Pyramid in Microservices Context
Test Pyramid in Microservices Context
 
Code Retreat
Code RetreatCode Retreat
Code Retreat
 
Booting into functional programming
Booting into functional programmingBooting into functional programming
Booting into functional programming
 
Currying and Partial Function Application (PFA)
Currying and Partial Function Application (PFA)Currying and Partial Function Application (PFA)
Currying and Partial Function Application (PFA)
 
Creating Lazy stream in CSharp
Creating Lazy stream in CSharpCreating Lazy stream in CSharp
Creating Lazy stream in CSharp
 
Value Objects
Value ObjectsValue Objects
Value Objects
 
Mars rover-extension
Mars rover-extensionMars rover-extension
Mars rover-extension
 
How Is Homeopathy Near To Yoga?
How Is Homeopathy Near To Yoga?How Is Homeopathy Near To Yoga?
How Is Homeopathy Near To Yoga?
 
Approaching ATDD/BDD
Approaching ATDD/BDDApproaching ATDD/BDD
Approaching ATDD/BDD
 
Paradigms Code jugalbandi
Paradigms Code jugalbandiParadigms Code jugalbandi
Paradigms Code jugalbandi
 
Data Reconciliation
Data ReconciliationData Reconciliation
Data Reconciliation
 
DRYing to Monad in Java8
DRYing to Monad in Java8DRYing to Monad in Java8
DRYing to Monad in Java8
 
CodeRetreat
CodeRetreatCodeRetreat
CodeRetreat
 
4-Code-Jugalbandi-destructuring-patternmatching-healthycode#apr2015
4-Code-Jugalbandi-destructuring-patternmatching-healthycode#apr20154-Code-Jugalbandi-destructuring-patternmatching-healthycode#apr2015
4-Code-Jugalbandi-destructuring-patternmatching-healthycode#apr2015
 
Jumping-with-java8
Jumping-with-java8Jumping-with-java8
Jumping-with-java8
 
3-CodeJugalbandi-currying-pfa-healthycodemagazine#mar2015
3-CodeJugalbandi-currying-pfa-healthycodemagazine#mar20153-CodeJugalbandi-currying-pfa-healthycodemagazine#mar2015
3-CodeJugalbandi-currying-pfa-healthycodemagazine#mar2015
 
CodeJugalbandi-Sequencing-HealthyCode-Magazine-Feb-2015
CodeJugalbandi-Sequencing-HealthyCode-Magazine-Feb-2015CodeJugalbandi-Sequencing-HealthyCode-Magazine-Feb-2015
CodeJugalbandi-Sequencing-HealthyCode-Magazine-Feb-2015
 
CodeJugalbandi-Expression-Problem-HealthyCode-Magazine#Jan-2015-Issue
CodeJugalbandi-Expression-Problem-HealthyCode-Magazine#Jan-2015-IssueCodeJugalbandi-Expression-Problem-HealthyCode-Magazine#Jan-2015-Issue
CodeJugalbandi-Expression-Problem-HealthyCode-Magazine#Jan-2015-Issue
 
The tao-of-transformation-workshop
The tao-of-transformation-workshopThe tao-of-transformation-workshop
The tao-of-transformation-workshop
 
Grooming with Groovy
Grooming with GroovyGrooming with Groovy
Grooming with Groovy
 

Recently uploaded

Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Peter Udo Diehl
 

Recently uploaded (20)

Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
 
НАДІЯ ФЕДЮШКО БАЦ «Професійне зростання QA спеціаліста»
НАДІЯ ФЕДЮШКО БАЦ  «Професійне зростання QA спеціаліста»НАДІЯ ФЕДЮШКО БАЦ  «Професійне зростання QA спеціаліста»
НАДІЯ ФЕДЮШКО БАЦ «Професійне зростання QA спеціаліста»
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 

Json Viewer Stories

  • 2. Story #1: View Raw Content As a developer, I want to see all the lines of a JSON text file as-is when I specify on command line, $> prettyjson -r responses.json So that I can know its contents.
  • 3. Story #2: View raw content with Line Numbers As a developer, I want to see all the lines of a JSON text file with line numbers when I specify on command line, $> prettyjson -l responses.json So that I can refer to lines with line numbers.
  • 4. Story #3: Show Pretty JSON As a developer I want to see the JSON text file in a pretty format with indentation $> prettyjson response.json So that I can clearly see the keys and their corresponding values. [ { "ticker": "AAPL", "high": 60.45, "tickMillis": { "high": 3000, "low": 2000 }, "low": 50.35, "price": 53.2, "name": "Apple Inc." }, { "ticker": "GOOG", "high": 120.34, "tickMillis": { "high": 2000, "low": 1000 }, "low": 90.67, "price": 97.28, "name": "Google Inc." } ]
  • 5. Story #4: Pretty JSON with Line #s As a developer I want to see the JSON text file in a pretty format along with indentation and line numbers as shown $> prettyjson -l response.json So that I can also refer data using line numbers. 1 [ 2 { 3 "ticker": "AAPL", 4 "high": 60.45, 5 "tickMillis": { 6 "high": 3000, 7 "low": 2000 8 }, 9 "low": 50.35, 10 "price": 53.2, 11 "name": "Apple Inc." 12 }, 13 { 14 "ticker": "GOOG", 15 "high": 120.34, 16 "tickMillis": { 17 "high": 2000, 18 "low": 1000 19 }, 20 "low": 90.67, 21 "price": 97.28, 22 "name": "Google Inc." 23 } 24 ]
  • 6. Story #5: Pygmentized JSON As a developer I want to see the JSON text file in a pretty format along with colours as shown $> prettyjson response.json So that I can recognise keys are blue, numbers are in yellow and strings are in green colour.
  • 7. NOTE: this command conflicts with Story #3. So, we introduce another option “nc” to produce monochrome (not colored) output. This will not break Story #3. $> prettyjson -nc response.json Story #5: Pygmentized JSON [ { "ticker": "AAPL", "high": 60.45, "tickMillis": { "high": 3000, "low": 2000 }, "low": 50.35, "price": 53.2, "name": "Apple Inc." }, { "ticker": "GOOG", "high": 120.34, "tickMillis": { "high": 2000, "low": 1000 }, "low": 90.67, "price": 97.28, "name": "Google Inc." } ]
  • 8. Story #6: Pygmentized JSON with Line numbers As a developer I want to see the JSON text file in a pretty format along with lines numbers in colour and colours as shown $> prettyjson -l response.json So that I can recognise keys are blue, numbers are in yellow and strings are in green colour.
  • 9. Story #7: View Raw with all possible options I want to see the JSON text file in a raw format with or without lines numbers, with to without colours $> prettyjson -l -r response.json $> prettyjson -r response.json $> prettyjson -l -r -nc response.json (same output as story#2)