NullCodable
@propertyWrapper
public struct NullCodable<Value> : Codable, Sendable where Value : Decodable, Value : Encodable, Value : Sendable
extension NullCodable: Equatable where Value: Equatable
A property wrapper to use on properties that should be encoded with a null
value (instead of being omitted).
-
The wrapped value.
Declaration
Swift
public var wrappedValue: Value?
-
Create a new property wrapper with the specified wrapped value.
Declaration
Swift
public init(wrappedValue: Value?)
Parameters
wrappedValue
The wrapped value.
-
Declaration
Swift
public init(from decoder: Decoder) throws
-
Declaration
Swift
public func encode(to encoder: Encoder) throws