Change ID default initializer, DecodableDefault for implicit decoding models. Add missing id encodes and decodes.
This commit is contained in:
parent
46bcd6618d
commit
d6096c7ee5
@ -65,6 +65,10 @@ extension DecodableDefault {
|
||||
public enum EmptyMap<T: Map>: Source {
|
||||
public static var defaultValue: T { [:] }
|
||||
}
|
||||
|
||||
public struct UUIDSource: DecodableDefaultSource {
|
||||
public static var defaultValue: String { Foundation.UUID().uuidString }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -74,6 +78,7 @@ extension DecodableDefault {
|
||||
public typealias EmptyString = Wrapper<Sources.EmptyString>
|
||||
public typealias EmptyList<T: List> = Wrapper<Sources.EmptyList<T>>
|
||||
public typealias EmptyMap<T: Map> = Wrapper<Sources.EmptyMap<T>>
|
||||
public typealias UUID = Wrapper<Sources.UUIDSource>
|
||||
}
|
||||
|
||||
extension DecodableDefault.Wrapper: Equatable where Value: Equatable {}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user