DateDecodingStrategy
The strategy to use for decoding Date values.
enum DateDecodingStrategyThe strategy to use for decoding Date values.
enum DateDecodingStrategys11Hummingbird21URLEncodedFormDecoderV20DateDecodingStrategyO What are these?427YRimport Hummingbirdstruct URLEncodedFormDecoderThe wrapper struct for decoding URL encoded form data to Codable classes
case deferredToDateDefer to Date for decoding. This is the default strategy.
case secondsSince1970Decode the Date as a UNIX timestamp from a JSON number.
case millisecondsSince1970Decode the Date as UNIX millisecond timestamp from a JSON number.
case iso8601Decode the Date as an ISO-8601-formatted string (in RFC 3339 format).
case formatted(DateFormatter)Decode the Date as a string parsed by the given formatter.
case custom((any Decoder) throws -> Date)Decode the Date as a custom value encoded by the given closure.
init(dateDecodingStrategy: URLEncodedFormDecoder.DateDecodingStrategy = .deferredToDate, userInfo: [CodingUserInfoKey : any Sendable] = [:]) Create URLEncodedFormDecoder
var dateDecodingStrategy: URLEncodedFormDecoder.DateDecodingStrategyThe strategy to use in Encoding dates. Defaults to .deferredToDate.
var userInfo: [CodingUserInfoKey : any Sendable]Contextual user-provided information for use during encoding.
func decode<T>(_ type: T.Type, from string: String) throws -> T where T : Decodable Decode from URL encoded form data to type
func decode<T>(_ type: T.Type, from request: Request, context: some RequestContext) async throws -> T where T : Decodable Extend URLEncodedFormDecoder to decode from Request.
protocol SendableA thread-safe type whose values can be shared across arbitrary concurrent contexts without introducing a risk of data races. Values of the type may have no shared mutable state, or they may protect that state with a lock or by forcing it to only be accessed from a specific actor.