2021-09-11
- Update top-level response members from
meta
,status
anddata
->meta
,errors
anddata
- Updated
Manifest Error Item
fields - Updated logic & added new aide
NewHTTPMultiErrorResponse
to support multiple error response objects in response - Refactored code
- Added logic to support users passing custom error transfer objects (
TransferObjectError
),reply.WithTransferObjectError
- Added
RefreshTransferObject
method call toTransferObjectError
- Added
- Updated Token attributes & methods on base
Transfer Object
to have a generic name to cover cases where API uses different token identifiersAccessToken
->TokenOne
&RefreshToken
->TokenTwo
- Added logic to set
StatusCode
if not set already. Defaults to400
.
2021-09-11
- Refactor Token attributes & methods to have a more general name to make use of cases where API uses different token identifiers less confusing
AccessToken
->TokenOne
&RefreshToken
->TokenTwo
- Dev can create custom
TransferObject
to set JSON attribute to match their use case
- Dev can create custom
- Added logic to set
StatusCode
if not set already. Defaults to400
. - Updated README to better describe the library
2021-09-10
- Refactored logic to allow users to pass custom error transfer objects (TransferObjectError),
reply.WithTransferObjectError
- Added
RefreshTransferObject
method call toTransferObjectError
- Added
- Updated
example simple api
to use the new Replier Option and update thetransfer object error
2021-09-10
- Added new aide
NewHTTPMultiErrorResponse
to support multiple error response - Updated
example simple api
to use the new aideNewHTTPMultiErrorResponse
- Added logic to handle/ create multiple error response
- Refactor code to make it more readable with new logic
2021-09-09
- Update top-level response members from
meta
,status
anddata
->meta
,errors
anddata
- Updated underlying logic to how an error is handled
- Updated
Manifest Error Item
attributes
2021-09-04
- Fixed bug in logic for merging error manifests
- Added helper functions (aides) to help users more efficiently use the library
2021-09-04
- Fixed bug in logic for merging error manifests
2021-09-03
- Initial logic for helper functions (
aides
) to help users more efficiently use the library
2021-08-31
- Added licensing information
- Fixed typos
2021-08-28
- Refactored code
- Utilise error returned in
NewHTTPResponse
- Added log entry for unfound manifest error item.
2021-08-27
- Updated logic for the setting headers.
- Added logic to default to JSON
content-type
2021-08-26
- Enforced
response priority
, priority is declared as follows:- Error response
- Token response (access token/ refresh token)
- Data response
- Default response
Note - Default response occurs if none of the attributes expected to satisfy the other response types is satisfied. The JSON response for the default response returned will be:
{
"data": "{}"
}
- Added ability to send responses based on singular error.
NOTE: If the error does not exist in the
error manifest
reply will default to 500 - Internal Server Error