1
- ![ REST API Response Builder for Laravel] ( docs/logo.png )
1
+ ![ REST API Response Builder for Laravel] ( docs/img/ logo.png )
2
2
3
3
# REST API Response Builder for Laravel #
4
4
5
5
See [ compatibility docs] ( docs/compatibility.md ) for details about backward compatibility!
6
6
7
7
## CHANGE LOG ##
8
8
9
+ * 6.2.0 (2019-10-19)
10
+ * Changed how auto-converter checks for supported classes (see [ Data Conversion] ( docs/docs.md#data-conversion ) )
11
+ * Data conversion now supports [ JsonResource] ( https://laravel.com/docs/6.0/eloquent-resources ) data class.
12
+ * Added unit test for ` ResponseBuilderServiceProvider::mergeConfg() ` .
13
+ * Moved data conversion code to separate ` Converter ` class.
14
+ * Added ` LICENSE.md ` file.
15
+ * Added Laravel 6.2 to Travis tests.
16
+ * Added unit tests for translation files.
17
+
9
18
* 6.1.2 (2019-10-02)
10
19
* Corrected ServiceProvider used for tests.
11
20
12
21
* 6.1.1 (2019-10-02)
13
22
* Fixed ` ResponseBuilderServiceProvider ` using unreferenced ` Arr ` class method (reported by yassir3wad).
14
-
23
+
15
24
* 6.1.0 (2019-09-28)
16
25
* ** BACKWARD INCOMPATIBLE CHANGES** ([ more info] ( docs/compatibility.md ) )
17
- * Created new library logo (see ` artwork/ ` folder)
26
+ * Created new library logo (see [ artwork/] ( artwork/ ) folder).
18
27
* Added more unit tests to improve coverage.
19
28
* Updated documentation.
20
29
* Worked arround Laravel's config merger wnot working properly with multi-dimensional config arrays.
@@ -24,13 +33,13 @@ See [compatibility docs](docs/compatibility.md) for details about backward compa
24
33
25
34
* v6.0.0 (2019-09-20)
26
35
* ** BACKWARD INCOMPATIBLE CHANGES** ([ more info] ( docs/compatibility.md ) )
27
- * Requires Laravel 6.0+ and PHP 7.2+ (see docs for legacy support hints).
36
+ * Requires Laravel 6.0+ and PHP 7.2+ (see [ docs] ( docs/legacy.md ) for legacy support hints).
28
37
* All API codes are now withing defined code range, incl. built-in codes.
29
- * Reserved code range lowered from former 63 down to 19 .
38
+ * Reserved codes reduced to 19 ( from former 63) .
30
39
* Added type hints to all method arguments and return values
31
- * ` ExceptionHandler ` returns Exception-type related HTTP codes now as per configuration .
40
+ * ` ExceptionHandler ` responses use exception specific HTTP code .
32
41
* Fixed ` ResponseBuilder::errorWithMessageAndData() ` not passing data properly.
33
- * Fixed exception message of ` ApiCodesHelpers::getMaxCode() ` .
42
+ * Fixed exception message thrown by ` ApiCodesHelpers::getMaxCode() ` .
34
43
* Corrected test cases list in ` testSuccess_DataAndHttpCode() ` .
35
44
* Fixed error code fallback in ` testRender_HttpException() ` test.
36
45
* Fixed ` testError_DebugTrace() ` not containing any asserts.
@@ -85,7 +94,7 @@ See [compatibility docs](docs/compatibility.md) for details about backward compa
85
94
* Fixed ` version ` in ` composer.json ` file
86
95
87
96
* v4.1.0 (2017-09-09)
88
- * [ RB-70] Added support for Laravel 5.5's auto-discovery feature
97
+ * ` [RB-70] ` Added support for Laravel 5.5's auto-discovery feature
89
98
90
99
* v4.0.2 (2017-04-13)
91
100
* Enforced HTTP code for error messages fits 400-499 range
@@ -94,68 +103,68 @@ See [compatibility docs](docs/compatibility.md) for details about backward compa
94
103
95
104
* v4.0.1 (2017-04-10)
96
105
* TestingHelpers trait's ` validateResponseStructure() ` method is now public
97
- * [ RB-64] Fixed Exception Handler generated HTTP code being out of allowed range in some cases
98
- * [ RB-65] Exception Handler Helper now deals with messages using non-UTF8 or broken encoding
106
+ * ` [RB-64] ` Fixed Exception Handler generated HTTP code being out of allowed range in some cases
107
+ * ` [RB-65] ` Exception Handler Helper now deals with messages using non-UTF8 or broken encoding
99
108
* Exception Handler's trace data is now properly placed into ` trace ` leaf
100
109
101
110
* v4.0.0 (2017-04-10)
102
111
* ** BACKWARD INCOMPATIBLE CHANGES** ([ more info] ( docs/compatibility.md ) )
103
- * [ RB-59] Added option to remap response JSON keys to user provided values
104
- * [ RB-54] Debug data no longer pollutes ` data ` leaf. Instead, it adds ` debug ` dictionary to root data structure.
105
- * [ RB-37] Added support for Laravel 5.3+ ` unauthenticated() ` in Exception Handler. See new config keys defails
106
- * [ RB-47] Exception Handler now supports ` FormRequests ` and returns all messages in ` ResponseBuilder::KEY_MESSAGES `
112
+ * ` [RB-59] ` Added option to remap response JSON keys to user provided values
113
+ * ` [RB-54] ` Debug data no longer pollutes ` data ` leaf. Instead, it adds ` debug ` dictionary to root data structure.
114
+ * ` [RB-37] ` Added support for Laravel 5.3+ ` unauthenticated() ` in Exception Handler. See new config keys defails
115
+ * ` [RB-47] ` Exception Handler now supports ` FormRequests ` and returns all messages in ` ResponseBuilder::KEY_MESSAGES `
107
116
* Uncaught ` HttpResponse::HTTP_UNAUTHORIZED ` exception is now handled same way ` authentication_exception ` is
108
- * [ RB-56] Added configurable key for debug trace added to returned JSON response (if enabled)
117
+ * ` [RB-56] ` Added configurable key for debug trace added to returned JSON response (if enabled)
109
118
* Added traits to help testing your config and ApiCodes with ease. See ` Unit Testing your ApiCodes ` docs for details
110
119
* ` ApiCodeBase ` class is now named ` BaseApiCodes `
111
- * [ RB-35] ExceptionHandlerHelper is now covered by tests
120
+ * ` [RB-35] ` ExceptionHandlerHelper is now covered by tests
112
121
113
122
* v3.2.1 (2017-04-06)
114
- * [ RB-49] Fixed ` artisan vendor:publish ` not publishing config file correctly
123
+ * ` [RB-49] Fixed ` artisan vendor: publish ` not publishing config file correctly
115
124
116
125
* v3.2.0 (2017-03-02)
117
- * [ RB-42] Default value of ` encoding_options ` include ` JSON_UNESCAPED_UNICODE ` to prevent unicode escaping
118
- * [ RB-41] Updated documentation
126
+ * ` [RB-42] Default value of ` encoding_options` include ` JSON_UNESCAPED_UNICODE` to prevent unicode escaping
127
+ * ` [RB-41] ` Updated documentation
119
128
120
129
* v3.1.0 (2017-02-28)
121
- * [ RB-38] Added ` encoding_options ` to control data-to-json conversion.
122
- * [ RB-38] Added optional encoding options args to all methods accepting ` data ` argument
123
- * [ RB-34] Added option to control ExceptionHandler behavior on debug builds
130
+ * ` [RB-38] Added ` encoding_options` to control data-to-json conversion.
131
+ * ` [RB-38] Added optional encoding options args to all methods accepting ` data` argument
132
+ * ` [RB-34] ` Added option to control ExceptionHandler behavior on debug builds
124
133
* ExceptionHandler's debug is now added as ` debug ` node to make it more clear where it comes from
125
134
126
135
* v3.0.3 (2017-02-24)
127
136
* No changes. v3.0.2 was incorrectly released
128
137
129
138
* v3.0.2 (2017-02-24)
130
- * [ RB-31] Fixed incorrect exception message thrown in case of incomplete ` classes ` config mapping (@dragonfire1119 )
139
+ * ` [RB-31] Fixed incorrect exception message thrown in case of incomplete ` classes` config mapping (@dragonfire1119 )
131
140
132
141
* v3.0.1 (2017-02-23)
133
142
* Updated ` composer.json ` to list ` laravel/framework ` among requirements
134
143
135
144
* v3.0.0 (2017-02-23)
136
145
* ** BACKWARD INCOMPATIBLE CHANGES** ([ more info] ( docs/compatibility.md ) )
137
- * [ RB-17] ` success() ` now allows to return API code as well
146
+ * ` [RB-17] ` success()` now allows to return API code as well
138
147
* Corrected default config file containing faulty and unneeded ` use ` entries
139
- * [ RB-20] Renamed ErrorCode class to ApiCodeBase
148
+ * ` [RB-20] ` Renamed ErrorCode class to ApiCodeBase
140
149
* ApiCodeBase's ` getMinCode() ` and ` getMaxCode() ` are now ` public `
141
150
* Improved error messages to be even more informative
142
151
* All exceptions thrown due to misconfiguration have ` CONFIG: ` message prefix now
143
152
* Renamed ` error_code ` param to ` api_code ` in all the method signatures
144
153
* ` :api_code ` is now code placeholder in strings (` :error_code ` is no longer supported)
145
154
* Default HTTP codes are now declared as constants ` DEFAULT_HTTP_CODE_xxx ` if you need to know them
146
155
* ` ApiCodeBase::getMap() ` now ensures ` map ` config entry of expected ` array ` type
147
- * [ RB-26] Added ` successWithCode() ` method
156
+ * ` [RB-26] ` Added ` successWithCode() ` method
148
157
149
158
* v2.2.1 (2017-02-20)
150
159
* Documentation split into separate files
151
160
152
161
* v2.2.0 (2017-02-20)
153
- * [ RB-5] Fixed error code range not being checked when used with custom message strings
162
+ * ` [RB-5] ` Fixed error code range not being checked when used with custom message strings
154
163
* ` successWithHttpCode() ` , ` errorWithDataAndHttpCode() ` , ` errorWithHttpCode() ` throws exception if ` http_code ` is ` null `
155
164
* ` http_code ` can be handed as null to all other methods and it will be replaced by default codes
156
165
* ` classes ` mapping now features ` method ` field to specify method name to call for automatic object conversion
157
- * [ RB-10] When ` $data ` is an ` array ` , all elements mapped via "classes" config will be converted recursively
158
- * [ RB-3] Unit tests are now part of the package
166
+ * ` [RB-10] When ` $data` is an ` array`, all elements mapped via "classes" config will be converted recursively
167
+ * ` [RB-3] ` Unit tests are now part of the package
159
168
160
169
* v2.1.2 (2016-08-24)
161
170
* Fixed exception code handling in ExceptionHandlerHelper (reported by Adrian Chen @absszero )
0 commit comments