Skip to content

JsonDiff is a WEB API that can show differences between two JSON encoded as base64 binary.

License

Notifications You must be signed in to change notification settings

juniormucciolo/JSONDiff

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JsonDiff

JsonDiff is a WEB API that can show differences between two JSON encoded as base64 binary.

Installation

  • Clone/Download repository;
  • Restore NuGet packages;
  • Point connection string to your LocalDB (webconfig > defaultConnection);
  • On Package Manager Console, type: Update-Database -verbose;
  • Run application, Will start at Swagger page, you can test from here.

Techs, Frameworks & Libraries

  • WebAPI
  • EntityFramework - CodeFirst
  • Migrations
  • MOQ
  • NUnit
  • LocalDB
  • Swagger

Unit test covarage

N|Solid

  • Removed repository from data report as all call are mocked using MOQ;
  • Report extracted using dotCover.

Exposed endpoints:

  • < host >/v1/diff/{id}/left
  • < host >/v1/diff/{id}/right
  • < host >/v1/diff/{id}
  • The property {id} is required and it will be the identifier to track the JSON.
  • The JSON must be encoded in base64 binary string and wrapped using double quotes.

Steps to perform a JSON diff:

  • Json string encoded as base64 binary should be sent to endpoint sides (left/right) as body:
PUT /v1/diff/{id}/left
"eyJpZCI6IjUwIn0="
PUT /v1/diff/{id}/right
"eyJpZCI6IjEwIn0="
  • After two side has ben sent to the endpoints with {id} tracked, you can call the endpoint /v1/diff/{id} using the previous {id}
GET /v1/diff/{id}
  • You will recieve results as:
{
    "id": "abc12345",
    "message": "Found 1 differences between jsons",
    "differences": [
        "value from id property changed from 50 to 10"
    ]
}
  • As application already has Swagger installed, You can use Swagger as well: N|Solid

License

MIT

About

JsonDiff is a WEB API that can show differences between two JSON encoded as base64 binary.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages