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: README.md
+23-28Lines changed: 23 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -66,14 +66,13 @@ return success_response(data) if success?
66
66
```
67
67
68
68
```json
69
+
// response status: 200
70
+
// response body:
69
71
{
70
-
"status": 200,
71
-
"json": {
72
-
"data": {
73
-
"a": 1,
74
-
"b": 2
75
-
}
76
-
}
72
+
"data": {
73
+
"a": 1,
74
+
"b": 2
75
+
}
77
76
}
78
77
```
79
78
@@ -87,37 +86,31 @@ return error_response(:bad_request_1) if failed?
87
86
```
88
87
89
88
```json
89
+
// response status: 400
90
+
// response body:
90
91
{
91
-
"status": 400,
92
-
"json":
93
-
{
94
-
"error_code": 400001,
95
-
"error_message": "bad request 1",
96
-
"error_key": "bad_request_1",
97
-
"a": 1,
98
-
"b": 2
99
-
}
92
+
"error_code": 400_001,
93
+
"error_message": "bad request 1",
94
+
"error_key": "bad_request_1"
100
95
}
101
96
```
102
97
103
-
You can also provide your custom error message and error data. If error data is a hash, it will be merged into the json response; if it is an array, it will be merged into the json response with an `error_data` key.
98
+
You can also provide your custom error message and error data. If error data is a hash, it will be merged into the json response; If it is an array, it will be merged into the json response with an `error_data` key.
0 commit comments