Swift Encode JSON
// for encoing your model or sturct must inherit codable protocol
var general = [str: products]
let encodedData = try? JSONEncoder().encode(general)
Tayyab Mubeen