     }
 }
 
-extension NSURL: JSONValueType {
+extension NSURL: JSONValue {
     public static func JSONValue(object: Any) throws -> NSURL {
         guard let urlString = object as? String, objectValue = NSURL(string: urlString) else {
             throw JSONError.TypeMismatch(expected: self, actual: object.dynamicType)

    }
}

//
// MARK: - JSONObjectConvertible
//

public protocol JSONObjectConvertible : JSONValueType {
    typealias ConvertibleType = Self
    init(json: JSONObject) throws
}

extension JSONObjectConvertible {
    public static func JSONValue(object: Any) throws -> ConvertibleType {
        guard let json = object as? JSONObject else {
            throw JSONError.TypeMismatch(expected: JSONObject.self, actual: object.dynamicType)
        }
        guard let value = try self.init(json: json) as? ConvertibleType else {
            throw JSONError.TypeMismatch(expected: ConvertibleType.self, actual: object.dynamicType)
        }

//

public enum JSONError: ErrorType, CustomStringConvertible {
    case KeyNotFound(key: String)
    case NullValue(key: String)
    case TypeMismatch(expected: Any, actual: Any)
    case TypeMismatchWithKey(key: String, expected: Any, actual: Any)
    
    public var description: String {
        switch self {
        case let .KeyNotFound(key):
            return "Key not found: \(key)"
        case let .NullValue(key):
            return "Null Value found at: \(key)"
        case let .TypeMismatch(expected, actual):
            return "Type mismatch. Expected type \(expected). Got '\(actual)'"
        case let .TypeMismatchWithKey(key, expected, actual):
