You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/api-docs.md
+62-2Lines changed: 62 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -315,7 +315,7 @@
315
315
316
316
## Errors
317
317
318
-
The possible error codes and description.
318
+
### The possible error codes and description
319
319
320
320
-`authentication_wrong_credentials`: The provided credentials are incorrect.
321
321
-`authentication_missing_credentials`: Required authentication credentials are missing.
@@ -334,4 +334,64 @@ The possible error codes and description.
334
334
-`database_error`: There was an error with the database operation.
335
335
-`redis_error`: There was an error with the Redis operation.
336
336
337
-
## END
337
+
### The possible error kinds and description
338
+
339
+
-`authentication_error`: An error occurred during the authentication process.
340
+
-`resource_not_found`: The requested resource could not be found.
341
+
-`validation_error`: There was a validation error with the provided data.
342
+
-`database_error`: An error occurred with the database operation.
343
+
-`redis_error`: An error occurred with the Redis operation.
344
+
345
+
### API error response samples
346
+
347
+
```json
348
+
{
349
+
"status": 404,
350
+
"errors": [
351
+
{
352
+
"code": "user_not_found",
353
+
"kind": "resource_not_found",
354
+
"message": "user not found: 12345",
355
+
"description": "user with the ID '12345' does not exist in our records",
356
+
"detail": { "user_id": "12345" },
357
+
"reason": "must be an existing user",
358
+
"instance": "/api/v1/users/12345",
359
+
"trace_id": "3d2b4f2d00694354a00522fe3bb86158",
360
+
"timestamp": "2024-01-19T16:58:34.123+0000",
361
+
"help": "please check if the user ID is correct or refer to our documentation at https://github.com/sheroz/axum-rest-api-sample/blob/main/docs/api-docs.md#errors for more information",
"message": "source account does not have sufficient funds for the transfer",
376
+
"reason": "source account balance must be sufficient to cover the transfer amount",
377
+
"instance": "/api/v1/transactions/transfer",
378
+
"trace_id": "fbb9fdf5394d4abe8e42b49c3246310b",
379
+
"timestamp": "2024-01-19T16:58:35.225+0000",
380
+
"help": "please check the source account balance or refer to our documentation at https://github.com/sheroz/axum-rest-api-sample/blob/main/docs/api-docs.md#errors for more information",
"help": "please check if the destination account ID is correct or refer to our documentation at https://github.com/sheroz/axum-rest-api-sample/blob/main/docs/api-docs.md#errors for more information.",
// "help": "please check if the user email is correct or refer to our documentation at https://github.com/sheroz/axum-rest-api-sample/blob/main/docs/api-docs.md#errors for more information",
48
+
// "help": "please check the source account balance or refer to our documentation at https://github.com/sheroz/axum-rest-api-sample/blob/main/docs/api-docs.md#errors for more information",
// "help": "please check if the destination account ID is correct or refer to our documentation at https://github.com/sheroz/axum-rest-api-sample/blob/main/docs/api-docs.md#errors for more information.",
// "help": "please check if the user birthdate is correct or refer to our documentation at https://github.com/sheroz/axum-rest-api-sample/blob/main/docs/api-docs.md#errors for more information."
83
+
// "help": "please check if the user birthdate is correct or refer to our documentation at https://github.com/sheroz/axum-rest-api-sample/blob/main/docs/api-docs.md#errors for more information.",
// "help": "please check if the user role is correct or refer to our documentation at https://github.com/sheroz/axum-rest-api-sample/blob/main/docs/api-docs.md#errors for more information",
0 commit comments