dynamically loading and parsing a JSON file

I am trying to load a .json file like so:

void Start () {
		TextAsset jsonObj = Resources.Load(Path.Combine("JSON","simple")) as TextAsset;
		SimpleTest glyphMap = JsonUtility.FromJson<SimpleTest>(jsonObj.text);
		print(glyphMap.name);}

My json file (named simple.json) looks like this:

{
 "name": "boop",
 "id": "69",
}

My SimpleTest class looks like this:

[System.Serializable]
public class SimpleTest {
	public string name;
	public int id;
}

This fails with an ArgumentException: JSON parse error: Missing a name for object member.

However, if instead of loading a json file I pass it a locally defined string, this works fine:

void Start () {
         string jsonString = @"{""name"": ""Steve"",""id"":""69""}";
         SimpleTest glyphMap = JsonUtility.FromJson<SimpleTest>(jsonString);
         print(glyphMap.name); // will print 'Steve'
}

I’ve tried formatting simple.json to be like my jsonString, using escape characters \" for quotes. Loading the json file works fine and when I print out jsonObj.text it looks as it should. Mainly, my console printout just says:

{
 "name": "boop",
 "id": "69",
}

Why can’t it find a name for an object member? Is this a json-syntax issue?

Well there must be something wrong with your file. You never would put an escaped string into a file. The escaping inside string literals within code is removed by the compiler at compile time. The excaping is only required because certain characters have a different meaning inside a code file (like the quotation marks which would end the string literal). Loading raw text from files / TextAssets should always work. Maybe you saved the file in a “strange” format.

It’s hard to tell from the information given. However i suggest, if you have a hex editor / viewer on your machine, to view the file as hex to see if there are any additional formatting characters (like the [UTF BOM (Byte Order Mark)][1] at the beginning).

If you don’t have a hex editor (which a programmer should have -.-) you can dump the file content to the console as hex. Just use this helper method:

public static string ToHex(string aText, string aSeperator = "")
{
    if (aSeperator == null) aSeperator = "";
    var bytes = System.Text.Encoding.ASCII.GetBytes(aText);
    var sb = new System.Text.StringBuilder(bytes.Length * (1 + aSeperator.Length));
    for (int i = 0; i < bytes.Length; i++)
        sb.AppendFormat("{0:X2}", bytes*).Append(aSeperator);*

if (aSeperator.Length > 0)
sb.Remove(sb.Length-aSeperator.Length,aSeperator.Length);
return sb.ToString();
}
You can simply pass in a string and it comes out as a stream of hex characters. You may want to pass an optional seperator (i recommend a space character).
Try this with both strings, your locally defined string as well as with the string loaded from the TextAsset. You may want to include the result of both in your question.
As a side note: Your “id” inside your JSON file is actually a string value. As far as i know the JsonUtility will try parse the string into an integer, but usually you want to store it as number:
{
“name”: “boop”,
“id”: 69,
}
[1]: Byte order mark - Wikipedia

Thanks @Bunny83 , upon further inspection it was the comma at the end of my json file (!!)
Valid json:

{
 "name": "boop",
 "id": 69
}