Releases: MarcinOrlowski/laravel-api-response-builder
Releases · MarcinOrlowski/laravel-api-response-builder
v6.3.1
v6.3.0
- BACKWARD INCOMPATIBLE CHANGES (more info)
- Signature of
ResponseBuilder::buildResponse()
changed to allow customization of finalmessage
entry (@hawezo). - Moved all code that produces messages for API codes to
ResponseBuilder::getMessageForApiCode()
. - Added
Validator::assertType()
helper method that validates var against set of allowed types. - Added
Validator::assertString()
helper.
v6.2.3
- Added Laravel 6.4 to Travis-CI unit tests.
- Corrected example in "Manipulating Response Object" docs.
v6.2.2
- Squashed multiple typographic errors in the documentation files.
v6.2.1
- Added Laravel 6.3 to Travis-CI unit tests.
- Splitted tests into separate folders per class tested.
- ExceptionHandler no longer tries to enforce UTF-8 on exception message.
- Added PHP 7.4-snapshot to unit tests
v6.2.0
- Changed how auto-converter checks for supported classes (see Data Conversion)
- Data conversion now supports JsonResource data class.
- Added unit test for
ResponseBuilderServiceProvider::mergeConfg()
. - Moved data conversion code to separate
Converter
class. - Added
LICENSE.md
file. - Added Laravel 6.2 to Travis tests.
- Added unit tests for translation files.
v6.1.2
- Corrected ServiceProvider used for tests.
v6.1.1
- Fixed
ResponseBuilderServiceProvider
using unreferencedArr
class method (reported by yassir3wad).
v6.0.0
- BACKWARD INCOMPATIBLE CHANGES (more info)
- Requires Laravel 6.0+ and PHP 7.2+ (see docs for legacy support hints).
- All API codes are now withing defined code range, incl. built-in codes.
- Reserved code range lowered from former 63 down to 19.
- Added type hints to all method arguments and return values
ExceptionHandler
returns Exception-type related HTTP codes now as per configuration.- Fixed
ResponseBuilder::errorWithMessageAndData()
not passing data properly. - Fixed exception message of
ApiCodesHelpers::getMaxCode()
. - Corrected test cases list in
testSuccess_DataAndHttpCode()
. - Fixed error code fallback in
testRender_HttpException()
test. - Fixed
testError_DebugTrace()
not containing any asserts. - Reformatted code to not exceed 132 columns, for better on-line readability.
ResponseBuilder::errorWithDataAndHttpCode()
accepts nownull
as http code.ResponseBuilder::errorWithHttpCode()
accepts nownull
as http code.- Fixed
ExceptionHandlerHelper
replacing HTTP codes above 499 with 400. - Changed default built-in message for
HTTP_NOT_FOUND
error. ExceptionHandler
now falls back toEX_UNCAUGHT_EXCEPTION
for all the cases.- Simplified
ExceptionHandlerHelperTest::testRender_HttpException()
test. - Removed
exception_handler.use_exception_message_first
feature. - Removed
ResponseBuilder::DEFAULT_API_CODE_OK
constant. - Removed
getReservedMinCode()
,getReservedMinCode()
,getReservedMessageKey()
methods. - Removed internal API code constants. Use corresponding methods to get proprt code value.
- Reimplemented Laravel config merger to support multi-dimensional configuration arrays too.
- Removed
response_key_map
configuration option. - You can now return HTTP codes from 5xx range with all error responses.
v4.1.9
- Fixed ApiCodesHelpers::getMaxCode() exception message
- Fixed ResponseBuilder::errorWithMessageAndData() not passing args properly