-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update OpenAPIKit version, add error types that are needed by this li…
…brary but were removed from OpenAPIKit.
- Loading branch information
1 parent
952af87
commit 253abc5
Showing
3 changed files
with
35 additions
and
3 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
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// | ||
// File.swift | ||
// | ||
// | ||
// Created by Mathew Polzin on 4/21/20. | ||
// | ||
|
||
import Foundation | ||
import OpenAPIKit | ||
|
||
extension OpenAPI { | ||
public enum TypeError: Swift.Error, CustomDebugStringConvertible { | ||
case invalidNode | ||
case unknownNodeType(Any.Type) | ||
|
||
public var debugDescription: String { | ||
switch self { | ||
case .invalidNode: | ||
return "Invalid Node" | ||
case .unknownNodeType(let type): | ||
return "Could not determine OpenAPI node type of \(String(describing: type))" | ||
} | ||
} | ||
} | ||
|
||
public enum EncodableError: Swift.Error, Equatable { | ||
case allCasesArrayNotCodable | ||
case exampleNotCodable | ||
case primitiveGuessFailed | ||
case exampleNotSupported(String) | ||
} | ||
} |