     }
 }
 
-struct dog {
+struct Dog:Decodable {
     var name:String
-    var aga:UInt
-}
-
-
-
-
+//    var aga:UInt
+    init(_ name:String) {
+        self.name = name
+    }
+    
+    init(from decoder:Decoder) {
+        let singleValueContainter = try! decoder.singleValueContainer()
+        let dogName = try! singleValueContainter.decode(String.self)
+        print(dogName)
+        self.init(dogName)
+    }
+}
+
+
+
+

struct Response<T:Decodable>:Decodable {
    var code:String
    var data:Any
    
    enum ResponseType : String{
        case ReponseTypeDictionary,ReponseTypeArray

            print(additionalInfo.count!)
            print("Array")
            let antiques = try values.decode([T].self, forKey: .data)
            self.init(code, antiques, ResponseType.ReponseTypeArray)
        }else{//Dictionary
            print("Dictionary")
            let antique = try values.decode(T.self, forKey: .data)
            self.init(code, antique,ResponseType.ReponseTypeDictionary)
        }
    }
}
