ContentDecoder
Conform a type to this protocol to make it usable for decoding data via Vapor’s ContentConfiguration
system.
protocol ContentDecoder : Sendable
Browse conforming typesConform a type to this protocol to make it usable for decoding data via Vapor’s ContentConfiguration
system.
protocol ContentDecoder : Sendable
import Vapor
Vapor is a framework for building server applications, APIs and websites in Swift. It provides a safe, performant and scalable foundation for building large complex backends.
struct ContentConfiguration
Configures which Encoder
s and Decoder
s to use when interacting with data in HTTP messages.
protocol Sendable
func decode<D>(_ decodable: D.Type, from body: ByteBuffer, headers: HTTPHeaders) throws -> D where D : Decodable
Legacy “decode object” method. The provided ByteBuffer
should be decoded as a value of the given type, optionally guided by the provided HTTPHeaders
.
func decode<D>(_ decodable: D.Type, from body: ByteBuffer, headers: HTTPHeaders, userInfo: [CodingUserInfoKey : Sendable]) throws -> D where D : Decodable
“Decode object” method. The provided ByteBuffer
should be decoded as a value of the given type, optionally guided by the provided HTTPHeaders
. The provided userInfo
dictionary must be forwarded to the underlying Decoder
used to perform the decoding operation.
func decode<D>(_ decodable: D.Type, from body: ByteBuffer, headers: HTTPHeaders, userInfo: [CodingUserInfoKey : Sendable]) throws -> D where D : Decodable