[Help] Can anyone give me a quick tip about parsing this mildly complex JSON structure? The recursion confuses me a little.

Are you really sure you want something like...

[
    ["enable_search_before_post", "true"],
    ["login", "SarahManning"],
    ["email", "[email protected]"]
]

...instead of...

{
    "enable_search_before_post": true,
    "login": "SarahManning",
    "email": "[email protected]"
}

?

In any case, not only do different calls to the Lithium REST API (for the Labview forums) give you different things back, but in a given response, different things are structured in different ways because they are different things. Are you aware that by flattening it all you may lose the information structure? Such as a user having a number of profiles and each profile having a number of configurations or that a thread contains different views each one with some messages each of them with some properties. That structuring is part of the information.

Simply flattening it will mean you lose the structure. The only way to keep it would be by doing a full de-normalization, which requires a bit more work than what you have.

Finally, if you still want to do it, I'd recommend writing descriptions for each structure and then parsing based on that schema.

/r/javascript Thread