I'm trying to serialize in VB .Net a JSON file that contains this:
"scripts": [[123, 80, [["whenKeyPressed", "space"], ["nextCostume"]]],
[55, 32, [["whenKeyPressed", "space"], ["doPlaySoundAndWait", "Hello"]]]]
<DataMember(Name:="scripts")> and it works fine for the rest of the file, but in this case, the attributes don't have names.
JSONlint.com, the JSON Validator, is saying this is valid JSON.
How am I suppose the qualify the DataMembers? Also, it has a nameless array in it, how can I can I access it?
Any help would be appreciated.
I finally found a workaround by assigning
scripts to a
List(Of Object) in the
DataContract, then casting
scripts to the desired type at runtime. I casted it as
IList(Of Object) for the lists and then iterated in them for
It doesn't "feel" as "object-oriented" as the rest and I can't reference the fields by name (since they have none), but it works (with a lot of casting, especially since I work with
Option Strict On).
If there is a better way, I am open to suggestions.