Spring Boot application for JSON base64 binary data comparison.
Type | Status | Description |
---|---|---|
Maven | mvn clean install sonar:sonar |
- JDK 10 or higher
- Maven 3.5.2 or higher
mvn test
mvn spring-boot:run
Note: the above example uses a local web container on port 8080.
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
}
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=="
}
Example: http://localhost:8080/v1/diff/1
Response body:
{
"message": "The JSON contents are equal!"
}
Note: result when both sides are equal!
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 |