Skip to content

Commit

Permalink
Update OpenAPIKit version, add error types that are needed by this li…
Browse files Browse the repository at this point in the history
…brary but were removed from OpenAPIKit.
  • Loading branch information
mattpolzin committed Apr 22, 2020
1 parent 952af87 commit 253abc5
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"repositoryURL": "https://github.com/mattpolzin/OpenAPIKit.git",
"state": {
"branch": null,
"revision": "ff8b447549499b80aed8b73b1e1a0f54f090991c",
"version": "0.28.0"
"revision": "abbfc112ebef55e4eff1bba04340289aa1b6ba09",
"version": "0.29.0"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ let package = Package(
targets: ["OpenAPIReflection"]),
],
dependencies: [
.package(url: "https://github.com/mattpolzin/OpenAPIKit.git", .upToNextMinor(from: "0.28.0")),
.package(url: "https://github.com/mattpolzin/OpenAPIKit.git", .upToNextMinor(from: "0.29.0")),
.package(url: "https://github.com/mattpolzin/Sampleable.git", .upToNextMajor(from: "2.1.0"))
],
targets: [
Expand Down
32 changes: 32 additions & 0 deletions Sources/OpenAPIReflection/OpenAPI+Errors.swift
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)
}
}

0 comments on commit 253abc5

Please sign in to comment.