ParseJSON issues

Does anyone know why ParseJSON handles this properly:

[ { "City": "Boston", "Team": "Red Sox" }, { "City": "New York", "Team": "Yankees" } ]

But not:

{ "Teams": [ { "City": "Boston", "Team": "Red Sox" }, { "City": "New York", "Team": "Yankees" } ] }

Both are valid json according to http://jsonlint.com/ but the latter causes a TypeMismatchException.

The first example is an array. The second example is an object containing an array. So you’d use different syntax.

For example 1:

Dim teams() As Auto = Xojo.Data.ParseJSON(JSONSampleText)

For example 2:

Dim team As xojo.Core.Dictionary = Xojo.Data.ParseJSON(JSONSampleText)

Thank you Paul!

I tried dimming as a dictionary and also as an array of auto, but not just auto! That did the trick and works with both examples.

Dim theData As Auto = Xojo.Data.ParseJSON( TextArea1.Text.ToText )