Network abstraction layer written in Swift.
This release brings support for ReactiveSwift 3.0
. Thank you to all the contributors making it possible! ❤️
.requestCustomJSONEncodable
case to Task
. #1443 by @evgeny-sureev.failsOnEmptyData
boolean support for the Decodable
map functions. #1508 by @jeroenbb94.ReactiveSwift
to 3.0.
#1470 by @larryonoff.validate
property of TargetType
to use new ValidationType
enum representing valid status codes. #1505 by @SD10, @amaurydavid.Endpoint
. See #1524 for discussion. #1529 by @zhongwuzw..uploadMultipart
, .uploadCompositeMultipart
, .uploadFile
, .downloadDestination
, and .downloadParameters
tasks through an endpointClosure
has no effect on the final request.
#1550 by @SD10, @sunshinejr.URLEncoding.httpBody
wasn't allowed as bodyEncoding
in Task.requestCompositeParameters()
. #1557 by @sunshinejr.This release brings full ReactiveSwift
3.0 support and minor enhancements. Thanks to all contributors that made it possible!
.requestCustomJSONEncodable
case to Task
. #1443 by @evgeny-sureev.failsOnEmptyData
boolean support for the Decodable
map functions. #1508 by @jeroenbb94.ReactiveSwift
to 3.0.
#1470 by @larryonoff.validate
property of TargetType
to use new ValidationType
enum representing valid status codes. #1505 by @SD10, @amaurydavid.Nothing better than a few bug fixes after the major release 😉
Decodable
mapping to object other than Array and Dictionary in a key path cause crash. #1405 by @ufosky..requestJSONEncodable
#1410 by @Vict0rS.Full Swift 4.0
, RxSwift 4.0
support and more! Thanks to all contributors that made it possible:
@devxoul @SD10 @LeLuckyVint @afonsograca @AndrewSB @BasThomas @pedrovereza @sunshinejr
Big ❤️ to all of you!
.parameterEncoding
case to MoyaError
. #1248 by @SD10..objectMapping
case to MoyaError
. #1335 by @devxoul..encodableMapping
case to MoyaError
. #1349 by @LeLuckyVint, @afonsograca and @sunshinejr..requestJSONEncodable
case to Task
. #1349 by @LeLuckyVint, @afonsograca and @sunshinejr.Decodable
object mapping methods to Moya.Response
. #1335 by @devxoul.Endpoint.init
so it doesn't have any default arguments (removing default argument .get
for method
parameter and nil
for httpHeaderFields
parameter). #1289 by @sunshinejr.NetworkActivityPlugin
so its networkActivityClosure
has now target: TargetType
argument in addition to change: NetworkActivityChangeType
. #1290 by @sunshinejr.Endpoint
's urlRequest
property to urlRequest()
a throwing method. #1248 by @SD10.Full Swift 4.0 support and more! RxSwift 4.0.0-rc.0 needed for RxSwift 4.0. Thanks to all contributors that made it possible!
.parameterEncoding
case to MoyaError
. #1248 by @SD10..objectMapping
case to MoyaError
. #1335 by @devxoul..encodableMapping
case to MoyaError
. #1349 by @LeLuckyVint, @afonsograca and @sunshinejr..requestJSONEncodable
case to Task
. #1349 by @LeLuckyVint, @afonsograca and @sunshinejr.Decodable
object mapping methods to Moya.Response
. #1335 by @devxoul.Endpoint.init
so it doesn't have any default arguments (removing default argument .get
for method
parameter and nil
for httpHeaderFields
parameter). #1289 by @sunshinejr.NetworkActivityPlugin
so its networkActivityClosure
has now target: TargetType
argument in addition to change: NetworkActivityChangeType
. #1290 by @sunshinejr.Endpoint
's urlRequest
property to urlRequest()
a throwing method. #1248 by @SD10.This is a big major release and thanks to everyone involved! 🎉 🎉 🎉
In this release there were two big changes:
rx
and reactive
namespaces.parameters
, parameterEncoding
and expanded task
.We also added Swift 4.0 support to Moya core (and preliminary for ReactiveSwift
) where support for RxSwift
will be in a next major release. We improved our test coverage from 76% up to 83%, added callbackQueue
s as an option for all requests (reactive or not!), headers
to TargetType
, improved AccessTokenPlugin
, started using Single<Response>
instead of Observable<Response>
for RxSwift normal requests and many, many more! Checkout the changelog below and have fun! 🎉 There is also a migration guide to help you make it through!
Oh, and if you find anything you are concerned about, make a new Issue - or better yet, make a PR with the fix! 😉
Endpoint
initializer.MoyaError
.headers
to TargetType
.RxMoyaProvider.request
to return a Single<Request>
.Moya.Response
's response
to use an HTTPURLResponse
instead of a URLResponse
.TargetTypes
so it no longer receives the Authorization: Bearer <token>
header by default when using AccessTokenPlugin
.queue
to callbackQueue
.ReactiveSwiftMoyaProvider
and RxSwiftMoyaProvider
. Use MoyaProvider
with reactive properties now: provider.reactive._
, provider.rx._
. In case you were subclassing reactive providers, please take a look at this PR from Eidolon. It covers migration from subclassing given providers, to usage by composition.requestWithProgress
for ReactiveSwiftMoyaProvider
.Moya.Error
,
endpointByAddingParameters(parameters:)
, endpointByAddingHttpHeaderFields(httpHeaderFields:)
, endpointByAddingParameterEncoding(newParameterEncoding:)
, endpointByAdding(parameters:httpHeaderFields:parameterEncoding)
, StructTarget
, filterStatusCodes(range:)
, filterStatusCode(code:)
, willSendRequest(request:target:)
, didReceiveResponse(result:target:)
, ReactiveCocoaMoyaProvider
, ReactiveSwiftMoyaProvider.request(token:)
.parameters
& parameterEncoding
in TargetType
with extended Task
cases.shouldAuthorize: Bool
in AccessTokenAuthorizable
with authorizationType: AuthorizationType
.token
in AccessTokenPlugin
with tokenClosure
.UploadType
and DownloadType
into Task
cases.URL(target:)
initializator that creates url from TargetType
.requestDataFormatter
in NetworkLoggerPlugin
to allow the client to interact with the request data before logging it.filter
/map
operators that were available for Observable<Response>
to Single<Response>
as well.AuthorizationType
to AccessTokenAuthorizable
representing request headers of .none
, .basic
, and .bearer
.Single<Response>
operators.Progress
object into the response when calling progress callback on completion.URLRequest
from Task
.RxSwift
to 3.3
.ReactiveSwift
to 2.0
.requestWithProgress
method on ReactiveSwift
module.Endpoint
initializer.