Help loading .json

I keep getting Thread 1: Fatal error: Couldn't parse Launchdata.json as Array<Product>: When loading this file:

[
  {
    "name":"Smartcard"
    "imageName":"Smartcard"
    "description":"A all new way to buy and sell stuff featuring RFID and NFC for touchless transactions and with local server you can pay with your phone."
    "department":"Ticki Finance"
    "productid":"1737484"
    "id":1
    "creator":"The Ticki Team"
  },
  {
    "name":"Ink pad"
    "imageName":"Inkpad"
    "description":"A quick and easy way to take fingerprints and stamp stamps 😝, And with a quick water activation taking only 15 seconds you can setup in no time. Also, refilling the ink chamber is super easy, all you have to do is put ink in the middle hole."
    "department":"Ticki Design"
    "productid":"7338388"
    "id":2
    "creator":"The Ticki Team"
  },
  {
    "name":"Wallet"
    "imageName":"Wallet"
    "description":"Ever had issues with your credit cards falling out of your pocket/wallet? Well this fixes any issues with the. Introducing Ticki Wallet. "
    "department":"Ticki Finance"
    "productid":"2444495"
    "id":3
    "creator":"The Ticki Team"
  },
  {
    "name":"Pencil Case"
    "imageName":"PencilCase"
    "description":"I always lose my my pencils. How about you? Well i'm fixing that today with ticki pencil case. A pencil case that can hold pencils, an eraser, and of course, tickies."
    "department":"Ticki Design"
    "productid":"3840398"
    "id":4
    "creator":"The Ticki Team"
  

with this code:

func load<T: Decodable>(_ filename: String) -> T {
  let data: Data

  guard let file = Bundle.main.url(forResource: filename, withExtension: nil)
  else {
    fatalError("Couldn't find \(filename) in main bundle.")
  }

  do {
    data = try Data(contentsOf: file)
  } catch {
    fatalError("Couldn't load \(filename) from main bundle:\n\(error)")
  }

  do {
    let decoder = JSONDecoder()
    return try decoder.decode(T.self, from: data)
  } catch {
    fatalError("Couldn't parse \(filename) as \(T.self):\n\(error)")
  }
}

Please help!!!! -techboss_11123

I keep getting Thread 1: Fatal error: Couldn't parse Launchdata.json as Array:

Is there a 2nd line of detail in that error message? Looks like your code is trying to output it, but I don’t know how fatalError handles line breaks. When you are able to see what the caught error is then the problem will be more clear.

But moving on to what it will actually tell you: that’s not valid JSON because it’s missing commas between the key/value pairs.

Help loading .json
 
 
Q