1. Terminology
-
This is Differ generated documentation based on Spring REST Docs.
-
All sources are available at github https://github.com/viusiumbeli/differ-core
2. Rest convention
2.1. HTTP verbs
Speakers Service tries to adhere as closely as possible to standard HTTP and REST conventions in its use of HTTP verbs.
Verb |
Usage |
|
Used to retrieve a resource |
|
Used to create a new resource |
|
Used to update an existing resource, including partial updates |
|
Used to update an existing resource, full updates only |
|
Used to delete an existing resource |
2.2. HTTP status codes
Differ Service tries to adhere as closely as possible to standard HTTP and REST conventions in its use of HTTP status codes.
| Status code | Usage |
|---|---|
|
Standard response for successful HTTP requests. The actual response will depend on the request method used. In a GET request, the response will contain an entity corresponding to the requested resource. In a POST request, the response will contain an entity describing or containing the result of the action. |
|
The request has been fulfilled and resulted in a new resource being created. |
|
The server successfully processed the request, but is not returning any content. |
|
The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). |
|
The requested resource could not be found but may be available again in the future. Subsequent requests by the client are permissible. |
|
The request could not be completed due to a conflict with the current state of the target resource. |
|
Validation error has happened due to processing the posted entity. |
3. Endpoints
3.1. DiffService
3.1.1. Get diff between versions
Curl example
$ curl 'http://localhost:8080/v1/differ?left=0001&right=0002' -i -X GET \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
HTTP Request
GET /v1/differ?left=0001&right=0002 HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080
HTTP Request parameters
| Parameter | Description |
|---|---|
|
An old version of API |
|
A new version of API |
HTTP Response
Success HTTP responses
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 179
{
"full" : {
"home" : {
"info" : {
"description" : "API for fetching user related information"
}
}
},
"onlyOnLeft" : { },
"onlyOnRight" : { }
}
Success response fields
| Path | Type | Description |
|---|---|---|
|
|
Entities presented in both versions |
|
|
Entities only on left version |
|
|
Entities only on right version |
Response body
{
"full" : {
"home" : {
"info" : {
"description" : "API for fetching user related information"
}
}
},
"onlyOnLeft" : { },
"onlyOnRight" : { }
}
Not Found HTTP responses
HTTP/1.1 404 Not Found
Content-Type: application/json;charset=UTF-8
Content-Length: 68
{
"message" : "No version 0002 file was found",
"cause" : null
}
Success response fields
| Path | Type | Description |
|---|---|---|
|
|
Error description, can show to user |
|
|
If any error occurred |
Response body
{
"message" : "No version 0002 file was found",
"cause" : null
}