2
2
3
3
# REST API Response Builder for Laravel #
4
4
5
- See [ compatibility docs] ( docs/compatibility.md ) for details about backward compatibility!
5
+ This library follows [ Semantic versioning] ( https://semver.org ) .
6
+ See [ compatibility docs] ( docs/compatibility.md ) for details about backward compatibility
7
+ before doing major upgrade!
6
8
7
9
## CHANGE LOG ##
8
10
11
+ * v9.0.0 (2020-10-17)
12
+ * ** BACKWARD INCOMPATIBLE CHANGES** ([ more info] ( docs/compatibility.md ) )
13
+ * [ RB-156] Added logic to deal with directly returned objects or arrays.
14
+ * [ RB-158] Passing primitives as direct payload (i.e. ` success(12.50); ` is now supported for ` array ` , ` boolean ` ,
15
+ ` double ` , ` integer ` and ` string ` types, configurable via new ` converter/primitives ` .
16
+ * Removed hadrcoded ` val ` key used by ` JsonSerializable ` converter.
17
+ * Introduced own exceptions for better error reporting. See [ src/Exceptions] ( src/Exceptions ) for more info.
18
+
9
19
* v8.1.1 (2020-10-15)
10
20
* [ RB-155] Fixed ` ResponseBuilder ` internals preventing exdending class code from
11
21
being invoked, thus making response object structure manipulation ineffective (reported by krek95)
@@ -62,7 +72,7 @@ See [compatibility docs](docs/compatibility.md) for details about backward compa
62
72
* Data converter now handles objects implementing ` JsonSerializable ` and ` Arrayable ` contracts as well.
63
73
64
74
* v6.3.2 (2019-11-07)
65
- * Added ` ResponseBuilder ::successWithMessage()` method.
75
+ * Added ` RB ::successWithMessage()` method.
66
76
* Entries in ` classes ` config array can now have ` pri ` (default 0) to enforce order while
67
77
merging config with a built-in configuration.
68
78
* Persian translation (Thanks to @FaridAghili ).
@@ -75,8 +85,8 @@ See [compatibility docs](docs/compatibility.md) for details about backward compa
75
85
76
86
* v6.3.0 (2019-11-02)
77
87
* ** BACKWARD INCOMPATIBLE CHANGES** ([ more info] ( docs/compatibility.md ) )
78
- * Signature of ` ResponseBuilder ::buildResponse()` changed to allow customization of final ` message ` entry (@hawezo ).
79
- * Moved all code that produces messages for API codes to ` ResponseBuilder ::getMessageForApiCode()` .
88
+ * Signature of ` RB ::buildResponse()` changed to allow customization of final ` message ` entry (@hawezo ).
89
+ * Moved all code that produces messages for API codes to ` RB ::getMessageForApiCode()` .
80
90
* Added ` Validator::assertType() ` helper method that validates var against set of allowed types.
81
91
* Added ` Validator::assertString() ` helper.
82
92
@@ -125,20 +135,20 @@ See [compatibility docs](docs/compatibility.md) for details about backward compa
125
135
* Reserved codes reduced to 19 (from former 63).
126
136
* Added type hints to all method arguments and return values
127
137
* ` ExceptionHandler ` responses use exception specific HTTP code.
128
- * Fixed ` ResponseBuilder ::errorWithMessageAndData()` not passing data properly.
138
+ * Fixed ` RB ::errorWithMessageAndData()` not passing data properly.
129
139
* Fixed exception message thrown by ` ApiCodesHelpers::getMaxCode() ` .
130
140
* Corrected test cases list in ` testSuccess_DataAndHttpCode() ` .
131
141
* Fixed error code fallback in ` testRender_HttpException() ` test.
132
142
* Fixed ` testError_DebugTrace() ` not containing any asserts.
133
143
* Reformatted code to not exceed 132 columns, for better on-line readability.
134
- * ` ResponseBuilder ::errorWithDataAndHttpCode()` accepts now ` null ` as http code.
135
- * ` ResponseBuilder ::errorWithHttpCode()` accepts now ` null ` as http code.
144
+ * ` RB ::errorWithDataAndHttpCode()` accepts now ` null ` as http code.
145
+ * ` RB ::errorWithHttpCode()` accepts now ` null ` as http code.
136
146
* Fixed ` ExceptionHandlerHelper ` replacing HTTP codes above 499 with 400.
137
147
* Changed default message for ` HTTP_NOT_FOUND ` error.
138
148
* ` ExceptionHandler ` now falls back to ` EX_UNCAUGHT_EXCEPTION ` for all the cases.
139
149
* Simplified ` ExceptionHandlerHelperTest::testRender_HttpException() ` test.
140
150
* Removed ` exception_handler.use_exception_message_first ` feature.
141
- * Removed ` ResponseBuilder ::DEFAULT_API_CODE_OK` constant.
151
+ * Removed ` RB ::DEFAULT_API_CODE_OK` constant.
142
152
* Removed ` getReservedMinCode() ` , ` getReservedMinCode() ` , ` getReservedMessageKey() ` methods.
143
153
* Removed internal API code constants. Use corresponding methods to get proper code value.
144
154
* Reimplemented Laravel config merger to support multi-dimensional configuration arrays too.
@@ -150,7 +160,7 @@ See [compatibility docs](docs/compatibility.md) for details about backward compa
150
160
151
161
* v4.1.9 (2019-08-08)
152
162
* Fixed ` ApiCodesHelpers::getMaxCode() ` exception message
153
- * Fixed ` ResponseBuilder ::errorWithMessageAndData()` not passing args properly
163
+ * Fixed ` RB ::errorWithMessageAndData()` not passing args properly
154
164
155
165
* v4.1.8 (2019-08-07)
156
166
* Added Laravel 6 to testing setup
@@ -199,7 +209,7 @@ See [compatibility docs](docs/compatibility.md) for details about backward compa
199
209
* ` [RB-59] ` Added option to remap response JSON keys to user provided values
200
210
* ` [RB-54] ` Debug data no longer pollutes ` data ` leaf. Instead, it adds ` debug ` dictionary to root data structure.
201
211
* ` [RB-37] ` Added support for Laravel 5.3+ ` unauthenticated() ` in Exception Handler. See new config keys defaults
202
- * ` [RB-47] ` Exception Handler now supports ` FormRequests ` and returns all messages in ` ResponseBuilder ::KEY_MESSAGES`
212
+ * ` [RB-47] ` Exception Handler now supports ` FormRequests ` and returns all messages in ` RB ::KEY_MESSAGES`
203
213
* Uncaught ` HttpResponse::HTTP_UNAUTHORIZED ` exception is now handled same way ` authentication_exception ` is
204
214
* ` [RB-56] ` Added configurable key for debug trace added to returned JSON response (if enabled)
205
215
* Added traits to help testing your config and ApiCodes with ease. See ` Unit Testing your ApiCodes ` docs for details
0 commit comments