Decoder
public extension Decoder
Helper methods for decoding instances of the various types in your content model.
-
Undocumented
Declaration
Swift
var canResolveLinks: Bool { get }
-
The
TimeZone
theDecoder
is using to offset dates by. Set throughClientConfiguration
.Declaration
Swift
var timeZone: TimeZone? { get }
-
Undocumented
Declaration
Swift
var contentTypes: [ContentTypeId : EntryDecodable.Type] { get }
-
The localization context of the connected Contentful space necessary to properly serialize entries and assets to Swift models from Contentful API responses.
Declaration
Swift
var localizationContext: LocalizationContext { get }
-
Helper method to extract the sys property of a Contentful resource.
Declaration
Swift
func sys() throws -> Sys
-
Helper method to extract the metadata property of a Contentful resource if it exists.
Declaration
Swift
func metadata() throws -> Metadata?
-
Extract the nested JSON container for the “fields” dictionary present in Entry and Asset resources.
Declaration
Swift
func contentfulFieldsContainer<NestedKey>(keyedBy keyType: NestedKey.Type) throws -> KeyedDecodingContainer<NestedKey> where NestedKey : CodingKey