Skip to content

1.1.0 - Simpler Parameters

Compare
Choose a tag to compare
@rakuyoMo rakuyoMo released this 14 Jan 07:35
· 60 commits to main since this release

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 renamed APIParameter.
  • 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 a block to a struct 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 and UInt objects that were converted to AnyObject can now be correctly converted to AnyAPIParameter types.
  • Container types (Array and Dictionary) will be checked for the number of elements when converting internal elements to AnyAPIParameter types. See: check for more details