It sounds like you might be looking for `to` from the `json` module: <https://nim-lang.org/docs/json.html#to%2CJsonNode%2Ctypedesc%5BT%5D>
That being said you could also work with the JSON object directly, just verify it's structure with something like `jsonschema` beforehand.