I’d like to traverse through this structure and find out what type each key:value pair belongs to, such as String, Object, Array etc., and drill down beneath a child object or array, until all objects/array have been determined to the string value level.
The goal is to convert any JSON data file into data table, simply by reading it and converting the entire file into a datatable.
If this exercise was successful, I’d like to see the following:
“name” = “test-api”
“expressionLanguage” = “VisualBasic”
“entryPoints.filePath” = “Main.xaml”
“entryPoints.UniqueId” = “236225b7-396d-49d0-a602-628269d13988”
…
etc
Its basically similar to flattening a array of arrays
The idea is to loop through each key…and check the type of the value inside that key…if type is jarray …then loop as array and get values…type as string then stop traversing…if type a jobj then traverse through keys again
I sure understand the logic. I was looking for some ideas on how to implement that since the structure is unknown. An array could have multiple levels of objects and arrays. Similarly, an Object could have multi-level arrays and objects.
In this example, notice designOptions, which has another object within it. In a complex situation there could be multiple objects one with in another. Same within an array as well.