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. ...@@ -336,14 +336,12 @@ Explains why an irrelevant file is irrelevant.
| Case | Code | Description | Response Body | | Case | Code | Description | Response Body |
| --- | --- | --- | --- | | --- | --- | --- | --- |
| Ok | `200` | explanation(s) successfully created | JSON object with properties `explanations` and `further_explanations` (=boolean=) | | 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). - `explanations`: A list of explanations (see below).
- `further_explanations`: `true` if more explanations are available - `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 #### Explanations
......
...@@ -6,13 +6,23 @@ ...@@ -6,13 +6,23 @@
"description": "The response body when the API returns an error.", "description": "The response body when the API returns an error.",
"properties": { "properties": {
"code": { "code": {
"description": "The HTTP status code of this error.",
"type": "integer", "type": "integer",
"minimum": 400, "minimum": 300,
"maxiumum": 599 "maxiumum": 599
}, },
"message": { "message": {
"description": "A string describing the error.",
"type": "string", "type": "string",
"minimumLength": 1 "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": [ "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