Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Commit

Permalink
Initialize draft specification for error object format
Browse files Browse the repository at this point in the history
  • Loading branch information
gmourier committed Aug 13, 2021
1 parent e301881 commit d11b654
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions text/0061-error-format.md
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.

0 comments on commit d11b654

Please sign in to comment.