-
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support nested multipart encoding (#57)
* Support nested multipart encoding * Clean up some comments and access modifiers * Remove unneeded return * Fix access modifiers * Add support for nested decode * Extend nested coding tests * Include part of Swift Collections for Swift 5.2 * Remove testing-only file that break 5.2 compat * Remove more unused files * Clean up and finalize (?) implementation - remove unused code - deprecate MultipartError - simplify decoding - augment error messages - remove attempt at null decoding - reenable test for URL decoding but change behavior slightly * Fix MultipartConvertible regression Also enables decoding single MultipartConvertible values * Remove dependency on swift-collections Thanks to @fabianfett for reminding that we should not rely on pre 1.0 dependencies. * Fix whitespaces and typo * Remove OrderedCollections as a target * Add OrderedCollections as an internal dependency * Comment out unused code This makes it build but not run yet * Uncomment enough to pass tests * Remove commented out code * Make OrderedCollections code internal * Update and rename NOTICES.txt * Remove redundant `//`s * Add changes summarize to vendored files * Guard against deeply nested objects Makes nesting depth configurable through the initializer. * Fix crash on failing to initialize from part * Centralize decoding value from MultipartPart - define decoding single value once on MultipartPart - avoid force unwrap * Improve error message
- Loading branch information
1 parent
2376b49
commit 8c666b7
Showing
33 changed files
with
3,561 additions
and
279 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// This source file is part of the Vapor open source project | ||
// | ||
// Copyright (c) 2017-2021 Vapor project authors | ||
// Licensed under MIT | ||
// | ||
// See LICENSE for license information | ||
// | ||
// SPDX-License-Identifier: MIT | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
This product contains a selection from the `OrderedCollection` module from | ||
Swift Collections. | ||
|
||
* LICENSE (Apache License 2.0): | ||
* https://swift.org/LICENSE.txt | ||
* HOMEPAGE: | ||
* https://github.com/apple/swift-collections |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,4 +29,3 @@ internal enum BasicCodingKey: CodingKey { | |
self = .index(intValue) | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
@available(*, deprecated) | ||
public enum MultipartError: Error, CustomStringConvertible { | ||
case invalidFormat | ||
case convertibleType(Any.Type) | ||
case convertiblePart(Any.Type, MultipartPart) | ||
case nesting | ||
case missingPart(String) | ||
case missingFilename | ||
|
||
public var description: String { "" } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.