1.1.0 - Simpler Parameters
We've made significant changes in this update, and there are some breaking changes that you'll need to adapt, but it's worth it!
Break Change
APIParametrizable
now renamedAPIParameter
.APIParameterConvertible
is no longer available to users, it is now an internal protocol of the module.APIRequestInfo
now needs to be initialized using APIParameterBuilder and specific parameters. See the init method for details.APIParameterBuilder
has changed from ablock
to astruct
and now you need to define your api using the following code:
@POST("/api/path")
static var someAPI: APIParameterBuilder<Arg>? = .init { $0 } // Use `.init { $0 }` instead of `{ $0 }`
The benefit of this change is that if you choose to use a Model directly as an api parameter instead of a dictionary or array, then Xcode can now check that the Model follows the Hashable & Encodable
protocols, which it could not do before.
Add
Date
,Float
,Character
andUInt
objects that were converted toAnyObject
can now be correctly converted toAnyAPIParameter
types.- Container types (
Array
andDictionary
) will be checked for the number of elements when converting internal elements toAnyAPIParameter
types. See: check for more details