Sunday, July 28, 2019

Comparing many json files

I wrote a tool to compare JSON files , code and documentation are on github.

SAMPLE OUTPUT


  :color:red:file01.json
  :color:red:file02.json
  :color:red:file03.json
  :color:red:file04.json

  :fruit:apple:file01.json
  :fruit:cherry:file02.json
  :fruit:apple:file03.json
  :fruit:MISSING:file04.json

  :inspiration:art:Pablo Picasso:file01.json
  :inspiration:art:Frida Kahlo:file02.json
  :inspiration:art:Pablo Picasso:file03.json
  :inspiration:art:MISSING:file04.json

  :inspiration:music:Dead Kennedys:file01.json
  :inspiration:music:Dead Kennedys:file02.json
  :inspiration:music:Dead Kennedys:file03.json
  :inspiration:music:MISSING:file04.json

  :inspiration:tools:MISSING:file01.json
  :inspiration:tools:["hammer", "rack"]:file02.json
  :inspiration:tools:MISSING:file03.json
  :inspiration:tools:MISSING:file04.json

  :vegetable:MISSING:file01.json
  :vegetable:MISSING:file02.json
  :vegetable:spinach:file03.json
  :vegetable:MISSING:file04.json

SAMPLE INPUT

file01.json

{
   "color": "red",
   "fruit": "apple",
   "inspiration": {"art":"Pablo Picasso","music":"Dead Kennedys"}
  }

file02.json

  {
   "color": "red",
   "fruit": "cherry",
   "inspiration": {"art":"Frida Kahlo","music":"Dead Kennedys","tools":["hammer","rack"]}
  }

file03.json

 {
   "vegetable": "spinach",
   "color": "red",
   "fruit": "apple",
   "inspiration": {"art":"Pablo Picasso","music":"Dead Kennedys"}
  }

file04.json

{
   "color": "red"
  }

No comments:

Post a Comment