Coder Social home page Coder Social logo

json64-diff's Introduction

Json64-diff

Spring Boot application for JSON base64 binary data comparison.

Travis Builds (Continuous Integration)

Type Status Description
Maven Build Status mvn clean install sonar:sonar

SonarCloud analysis of Json64-diff project (Continuous Code Quality)

sonar-quality-gate sonar-coverage sonar-bugs sonar-vulnerabilities

Development Environment

Build Requirements

Run Unit and Integration Tests

mvn test

Run Spring Boot Application

mvn spring-boot:run

Rest API Swagger Documentation

Note: the above example uses a local web container on port 8080.

Request & Response Examples

API Resources

POST /v1/diff/[id]/left

Example: http://localhost:8080/v1/diff/1/left

Request headers: Content-Type:"application/json"

Request body: (JSON base64 encoded binary data)

eyAibmFtZSI6IlRoaWFnbyBUZWl4ZWlyYSIgfQ==

Note: real JSON value is { "name":"Thiago Teixeira" }

Response body:

{
    "id": 1,
    "left": "eyAibmFtZSI6IlRoaWFnbyBUZWl4ZWlyYSIgfQ==",
    "right": null
} 

POST /v1/diff/[id]/right

Example: http://localhost:8080/v1/diff/1/right

Request headers: Content-Type:"application/json"

Request body: (JSON base64 encoded binary data)

eyAibmFtZSI6IlRoaWFnbyBUZWl4ZWlyYSIgfQ==

Note: real JSON value is { "name":"Thiago Teixeira" }

Response body:

{
    "id": 1,
    "left": "eyAibmFtZSI6IlRoaWFnbyBUZWl4ZWlyYSIgfQ==",
    "right": "eyAibmFtZSI6IlRoaWFnbyBUZWl4ZWlyYSIgfQ=="
}

GET /v1/diff/[id]

Example: http://localhost:8080/v1/diff/1

Response body:

{
    "message": "The JSON contents are equal!"
}

Note: result when both sides are equal!

Possible results for these GET requests:

When Get Response body will be HTTP Status Code Note
Sides are equal { "message": "The JSON contents are equal!" } 200 OK
Sides have not the same size { "message": "The JSON contents have not the same size!" } 200 OK
Sides have the same size, but different bytes { "message": "The JSON contents have the same size, but offsets are different: 19" } 200 OK In this case, 19 is the only different position
The [id] path variable is not found in repository 404 Not Found

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.