Getting KeyNotFoundException and I can't understand why

Hello Unity Community!

I’m trying to make an inventory system for my game, so I’ve read a bit on the subject and now I’m following a tutorial of using LitJson in Unity. However, when running my code I get “KeyNotFoundException: The given key was not present in the dictionary.”.

Here is my code:

using UnityEngine;
using System.Collections;
using LitJson;
using System.Collections.Generic;
using System.IO;

public class script_ItemDatabase : MonoBehaviour {
    private List<Item> database = new List<Item>();
    JsonData itemData;

    void Start()
    {
        itemData = JsonMapper.ToObject(File.ReadAllText(Application.dataPath+"/StreamingAssets/Items.json"));
        ConstructItemDatabase();
    }

    public Item GetItemByID(int index)
    {
        for(int i = 0; i < database.Count; i++)
        {
            if(database*.ID==index)*

return database*;*
}
return null;

}

void ConstructItemDatabase()
{
for(int i = 0; i < itemData.Count; i++)
{
database.Add(new Item((int)itemData*[“id”],*
itemData*[“name”].ToString(),*
itemData*[“description”].ToString(),*
(int)itemData*[“damage”],*
(int)itemData*[“firerate”],*
(bool)itemData*[“stackable”],*
itemData*[“slug”].ToString()));*
}
}

}
And here’s my json:
{
* {*
* “id”:0,*
* “name”:“Test Gun”,*
* “description”:“It’s a gun.”,*
* “damage”:3,*
* “firerate”:2,*
* “stackable”:false,*
* “slug”:“duck_yellow”
_ }
}
The error shows up on the itemData = JsonMapper.ToObject(File.ReadAllText(Application.dataPath+"/StreamingAssets/Items.json")); line. Since I’m new to this subject I would like to understand why the error shows up, what does it actually mean, and, of course, how can I fix it? Am I using the library incorrectly? Did I set up my json improperly?
I know there’s a lot of questions and answers on the web regarding this error, but so far I don’t have enough experience using dictionaries to fix my code on my own.
Thanks for your time!
-Ashky*_

This is not a valid JSON notation. The curly brackets represents an object. Objects always contain key-value pairs. It looks like you want an array with several objects in there, so your JSON representation should look like this;

 [
     {
         "id":0,
         "name":"Test Gun",
         "description":"It's a gun.",
         "damage":3,
         "firerate":2,
         "stackable":false,
         "slug":"duck_yellow"
     }
 ]

Note the square brackets which represents an array.