Using MiniJSON

Hello all, so I am trying to get some data from wikipedia using a www call to their api. I am running into trouble when i get the returned json data. I have no clue how to handle it. So here is what I currently have

IEnumerator RequestURL(string url){
		WWW www = new WWW(url);
		
		float elapsedTime = 0.0f;
		while (!www.isDone) {
      		elapsedTime += Time.deltaTime;   
      		if (elapsedTime >= 10.0f) break;
      		yield return null;  
    	}
    	if (!www.isDone || !string.IsNullOrEmpty(www.error)) {
      		print("Error: " + www.error);
      		yield break;
    	}
     	jsonResponse = www.text;
		
		print(jsonResponse);
		
		Dictionary<string,object> search = Json.Deserialize(jsonResponse) as Dictionary<string,object>;
		
	}

so how would I then reference my data when it is formatted like this:

[“Search value”,[“search value received”, “search value received 2” ]]

from my understanding of json the search value isn’t paired with the values received. The values received are a keyless array? I am so confused and could use a little help?

I believe MiniJSON was not designed to handle any JSON, but rather to serialize/deserialize Dictionary<string, object>.

The JSON string you mentioned, is not built like that and MiniJSON will return null if you try to parse it. Your JSON string is an array, first element is a string, and a second element is a an array of strings.

Here is an example of a JSON string that does work with MiniJSON, just so you know how to reference elements in a MiniJSON dictionary:

var jsonString = "{\"Search value\":[\"search value received\", \"search value received 2\" ]}";
var dict = Json.Deserialize(jsonString) as Dictionary<string,object>;
var result = (List<object>)dict["Search value"];
Debug.Log(result[0]);

Bottom line, as far as I can tell:
If you want to parse an external JSON that you have no control over its format, MiniJSON will not help you.

If you want to use JSON as means of serializing and deserializing some of your own data, MiniJSON will be just fine.