🏞 Parses and serializes multipart-encoded data with Codable support.
Add Sendable Conformances by @0xTim in #90
Add Sendable annotations to remove warning when building with complete concurrency checking.
Bumps the minimum supported Swift version to 5.7
Full Changelog: https://github.com/vapor/multipart-kit/compare/4.5.4...4.6.0
Fixes an issue where the Decodable
object is expecting a single part, but receives a set of keys causing the FormDataDecoder
to get stuck in an infinite loop and eventually crash. This changes the behaviour to throw an error in this case
Match Vapor's support
Removes the vended copy of Swift Collections and adds it as a dependency.
Resolves #82
Remove the platform requirements as they're not needed and it allows MultipartKit to be used on more platforms.
Resolves #77
Add FormDataDecoder.decode
with ByteBuffer
parameter and use this function in the other decode
functions. This avoids unnecessary conversions from ByteBuffer to [UInt8] and back.
Add FormDataDecoder.decode
with ByteBuffer
parameter
Resolves #75
Supports indexed array elements when decoding and encoding form data (fixes #67, replaces #69).
Indicating that a value belongs to an array can now be done by appending [0]
, [1]
, etc. to the name, as an alternative to the already supported []
. This allows for representing nested data inside elements in an array.
For instance, let matrix: [[Int]] = [[42,21]]
can now be represented using part names matrix[0][0]
and matrix[0][1]
. Without indexed array elements there is no way to distinguish the above from [[42],[21]]
.
Note:
FormDataEncoder
now also includes indexes for array types in its output.
Credits go to @chocoford for identifying the issue, the test cases and the initial PR!
Redesign FormDataEncoder and FormDataDecoder to better align with Codable's intended behavior.
userInfo
property to FormDataDecoder
and FormDataEncoder
Fixes regression that broke falling back to Codable
for types not conforming to MultipartPartConvertible
(#66, fixes #65)
Note: this removes conformance of UUID
to MultipartPartConvertible
introduced in 4.2.0 because it is no longer needed.
Add support for encoding and decoding UUID
s (#64)