Parse json using x++ without contract classes

For reference, Pranav’s original thread is Translate table data form one language to another.

I’m assuming you’re talking about .NET classes defined in System.Text.Json.Nodes namespace. (Please include such information next time.)

I don’t see any Get() method in JsonArray documentation. Therefore I agree with the compiler - such a method simply doesn’t exist. Look into the documentation to see what methods and properties you can use.

In your case, use an enumerator. For example:

System.Collections.IEnumerator enumerator = jsonArray.GetEnumerator();
 
while (enumerator.MoveNext())
{
    JsonObject translations = enumerator.Current as JsonObject;
}
1 Like