KeyedDecodingContainer

public extension KeyedDecodingContainer
  • Default implementation of decoding a DefaultCodable

    Decodes successfully if key is available if not fallsback to the default value provided.

    Declaration

    Swift

    func decode<P>(_: DefaultCodable<P>.Type, forKey key: Key) throws -> DefaultCodable<P> where P : DefaultCodableStrategy
  • Default implementation of decoding a DefaultCodable where its strategy is a BoolCodableStrategy.

    Tries to initially Decode a Bool if available, otherwise tries to decode it as an Int or String when there is a typeMismatch decoding error. This preserves the actual value of the Bool in which the data provider might be sending the value as different types. If everything fails defaults to the defaultValue provided by the strategy.

    Declaration

    Swift

    func decode<P>(_: DefaultCodable<P>.Type, forKey key: Key) throws -> DefaultCodable<P> where P : BoolCodableStrategy

OptionalISO8601

OptionalISO8601OrSecondsSince1970