Skip to content

Instantly share code, notes, and snippets.

@macbaszii
Last active August 17, 2016 11:10
Show Gist options
  • Save macbaszii/4d2ff203c486811962a76cbb9b06d3d2 to your computer and use it in GitHub Desktop.
Save macbaszii/4d2ff203c486811962a76cbb9b06d3d2 to your computer and use it in GitHub Desktop.
import Foundation
import ObjectMapper
public protocol APIError: Mappable {
var type: String? { get set }
var message: String? { get set }
}
public class ExampleAPIError: APIError {
public var type: String?
public var message: String?
required public init?(_ map: Map) {
}
public func mapping(map: Map) {
type <- map["error.type"]
message <- map["error.message"]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment