This repository has been archived by the owner on Mar 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initialize draft specification for error object format
- Loading branch information
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
- Title: Error Format | ||
- Start Date: 2021-08-13 | ||
- Specification PR: [#61](https://github.com/meilisearch/specifications/pull/61) | ||
- Discovery Issue: [#44](https://github.com/meilisearch/product/issues/44#issuecomment-896121211) | ||
|
||
# Error Format | ||
|
||
## 1. Functional Specification | ||
|
||
### I. Summary | ||
|
||
The error format is updated to no longer contain unnecessary `error` prefix terms in the names of these attributes. The context is clear enough to understand that this is an `error` object. | ||
|
||
#### Summary Key Points | ||
|
||
- `error` is removed from attributes name. | ||
|
||
### II. Motivation | ||
|
||
The main motivation is to stabilize the current `error` resource to a version that conforms to our API convention and thus allow future evolutions on a more solid base. This specification avoids adding unnecessary information in the object's attribute names. | ||
|
||
### III. Explanation | ||
|
||
#### Error Format Definition | ||
|
||
| Field name | type | Description | | ||
|------------|--------|--------------------------------------------------------------------------| | ||
| message | string | A human-readable message providing context and details about the error | | ||
| code | string | An error code | | ||
| type | string | An error type for which the error code is linked | | ||
| link | string | An URL to the related error-page details | | ||
|
||
e.g. 401 Unauthorized Response example | ||
|
||
``` | ||
{ | ||
"message": "authorization header is missing", | ||
"code": "missing_authorization_header", | ||
"type": "authentication_error", | ||
"link": "https://docs.meilisearch.com/errors#missing_authorization_header" | ||
} | ||
``` | ||
|
||
## 2. Technical details | ||
N/A | ||
|
||
## 3. Future Possibilities | ||
|
||
- Add a `parameter` attribute in the `error` object to indicate which parameter of the request caused an error. |