5.0.0-beta.1
·
120 commits
to master
since this release
TRON now requires:
- Xcode 10
- Swift 4 and higher
- iOS/tvOS 10 and higher
- watchOS 3 and higher
- macOS 10.12 and higher
Added
- Complete documentation
TRONDataResponseSerializer
andTRONDownloadResponseSerializer
structs to encapsulate serialization of responses using closure.- All test suite now uses
StubbingURLProtocol
to stop tests from sending network requests. Closes #21. - Additional
JSONDecodable
conformances have been added for arithmetic types such asInt8...Int64
,UInt8...64
.
Removed
EmptyResponse
type was replaced withAlamofire.Empty
struct to not interfere withAlamofire.EmptyResponse
protocol.TRON.stubbingShouldBeSuccessful
property since now each stub directly defines it's behavior instead of global setting- Conditional conformance of
Array
toJSONDecodable
- Convenience download methods on
CodableSerializer
andJSONDecodableSerializer
AuthorizationRequirement
enum. Please useAlamofire.RequestAdapter
andSession.adapter
property to adapt request, when additional headers are needed.HeaderBuildable
protocol andHeaderBuilder
types. Please useBaseRequest.headers
property of typeAlamofire.HTTPHeaders
directly.ErrorHandlingDataResponseSerializerProtocol
andErrorHandlingDownloadResponseSerializer
protocol. Now,ErrorModel
on all requests conforms toErrorSerializable
protocol, that contains initializer that allows to create it directly.CodableDownloadParser
andJSONDecodableDownloadParser
, replacement classDownloadSerializer
has been introduced, it allows to create a data model by implementingDownloadResponseSerializerProtocol
Breaking
headers
property ofBaseRequest
now containsHTTPHeaders
type instead of[String: String]
. Please note that along withHeaderBuilder
removal TRON no longer sends 'Accept':'application/json' header by default.APIError
is changed to be able to acceptSerializedObject
and is now a class with nullable initializer. Also,DownloadAPIError
type has been introduced for download errors, that do not haveData
in them, but havefileURL
instead.Plugin
methods that previously acceptedAPIError<ErrorModel>
now acceptErrorModel
directly. AddeddidSuccessfullyParseDownloadResponse
anddidReceiveDownloadResponse
methods.- All concrete implementations of
DataResponseSerializerProtocol
such asCodableParser
andJSONDecodableParser
now have only one generic argument -Model
and are only parsing model type. JSONDecodableParser
andCodableParser
now have only one generic argument -Model
, sinceErrorModel
is now moved toErrorSerializable
protocol, that does not depend on any particular serializer.APIStub
has been rewritten from scratch to allow injecting only results of network request(URLRequest
,HTTPURLResponse
,Data
,Error
andfileURL
) as opposed to actualModel
anderrorModel
as well as definition of successful/unsuccessful requests.APIStub
now is been attached toAlamofire.Request
when stubbing for this particular request has been enabled. Rewrite also allows plugin callbacks to be called more consistently for both stubbed and unstubbed cases.rxMultipartResult
method onUploadRequest
method was removed sinceUploadRequest
for multipart requests in Alamofire 5 is now synchronous and now does not require special handling. You can now callrxResult
replacement method instead.