     }
 }
 
-public class JSONDictionary: JSONWritableType, ExpressibleByDictionaryLiteral {
+public class JSONDictionary: ExpressibleByDictionaryLiteral {
     
     public init() {
         source = [:]


public protocol JSONWritableType {
    
    var jsonValue: Any { get }
}

extension String: JSONWritableType {
    public var jsonValue: Any {
        return self
    }
}

extension NSNumber: JSONWritableType {
    public var jsonValue: Any {
        return self
    }
}

extension Int: JSONWritableType {
    public var jsonValue: Any {
        return self
    }
}

extension Int8: JSONWritableType {
    public var jsonValue: Any {
        return NSNumber(value: self)
    }
}

extension Int16: JSONWritableType {
    public var jsonValue: Any {
        return NSNumber(value: self)
    }
}

extension Int32: JSONWritableType {
    public var jsonValue: Any {
        return NSNumber(value: self)
    }
}

extension Int64: JSONWritableType {
    public var jsonValue: Any {
        return NSNumber(value: self)
    }
}

extension Float: JSONWritableType {
    public var jsonValue: Any {
        return NSNumber(value: self)
    }
}

extension Double: JSONWritableType {
    public var jsonValue: Any {
        return NSNumber(value: self)
    }
}

extension Bool: JSONWritableType {
    public var jsonValue: Any {
        return self
    }
}

public class JSONArray: JSONWritableType, ExpressibleByArrayLiteral {
    
    public private(set) var source: [Any]
    

    }
    
    public func add(key: String, value: JSONArray) {
        source[key] = value.source
    }
    
    public func add(key: String, value: JSONDictionary) {
        source[key] = value.source
    }
    
    public func build() throws -> Data {
        return try JSONSerialization.data(withJSONObject: source, options: .prettyPrinted)
    }
    
//    public var jsonValue: JSONWritableType {
//        return source
//    }
    
    public typealias Key = String
    public typealias Value = JSONWritableType
