Error with creating JSON object.

I am trying to deserialize a JSON file. I created the file myself. I am getting this error when I try to deserialize it. I am able to read the file as normal and output its contents, but when I try to create an object from it, it errors out. There are no "/" in the file.

This is my call. It errors out on the second line.
string json = "moves.json"; //Actual filepath is hardcoded
var moves = JsonSerializer.Deserialize<List<Moves>>(json);

This is the object class.
using System;
namespace ok
{
    public class Moves
    {
        public string Name { get; set; }
        public string Type { get; set; }
        public int Attack { get; set; }
        public int Accuracy { get; set; }
    }
}

This is an example of my JSON.
{
  "Moves": [
    {
      "Name": "Leech Life",
      "Type": "BUG",
      "Attack": 15,
      "Accuracy": 100
    },
    {
      "Name": "Pin Missile",
      "Type": "BUG",
      "Attack": 15,
      "Accuracy": 85
    }
  ]
}
Screen_Shot_2023-03-26_at_10.19.52_AM.png
Was this page helpful?