v0.3.0
Failing Properties
The biggest change in this release is that properties themselves handle validations, instead of the parent type. You will notice that quite a few initializers don't accept the primitive types like String
or Int
, but instead something like Failable<Int, ...>
. You can wrap the those value in .init(value)
and everything should work again:
try Name(
prefix: .init("Mr."),
given: .init("Caleb"),
surname: .init("Kleveter"),
middle: .init("J"),
suffix: .init(nil),
full: .init("Caleb J Kleveter")
)
Instead of setting the properties with the .set
method like you used to:
try name.set(\.prefix <~ nil)`
You can use plain old property setting:
try name.prefix <~ nil
The Environment.domain
property is now public, so you can easily get the API domain for the endpoints you are using.