Commit ae7173fe authored by Siebers, Michael's avatar Siebers, Michael
Browse files

refined error response JSON schema

parent ebc7bfc5
......@@ -336,14 +336,12 @@ Explains why an irrelevant file is irrelevant.
| Case | Code | Description | Response Body |
| --- | --- | --- | --- |
| Ok | `200` | explanation(s) successfully created | JSON object with properties `explanations` and `further_explanations` (=boolean=) |
| Bad Request | `400` | item is not irrelevant and thus requesting an explanation is not possible | JSON object with properties `code` and `message` |
| Bad Request | `400` | item is not irrelevant and thus requesting an explanation is not possible | an [Error response](<#json_error>) |
- `explanations`: A list of explanations (see below).
- `further_explanations`: `true` if more explanations are available
- `code`: the HTTP status code (400)
- `message`: an error message
On success, the response body follows this [JSON schema](</doc/schema/response-explain-schema.json>). Otherwise, the response body follows the [error schema](</doc/schema/response-error-schema.json>).
On success, the response body follows this [JSON schema](</doc/schema/response-explain-schema.json>).
#### Explanations
......
......@@ -6,13 +6,23 @@
"description": "The response body when the API returns an error.",
"properties": {
"code": {
"description": "The HTTP status code of this error.",
"type": "integer",
"minimum": 400,
"minimum": 300,
"maxiumum": 599
},
"message": {
"description": "A string describing the error.",
"type": "string",
"minimumLength": 1
},
"location": {
"description": "The HTTP location this error relates to (error-dependent).",
"type": "string"
},
"path": {
"description": "The URL path (on this server) the error originates.",
"type": "string"
}
},
"required": [
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment