#convert json to class definition

8 messages · Page 1 of 1 (latest)

cobalt scroll
#

Evening all. I don't know if it's the red wine, age or stupidity but I am having a problem converting this json

    "foo": null,
    "bar": {
      "baz": null,
      "bish": null,
      "foobar": {
        "x":null,
        "y":null
      }
    },
    "quux": null
}

into an appropriate interface / class definition and would appreciate some kind soul helping this simpleton out 😉

civic prairie
cobalt scroll
#

yeah, I tried that but the problem is the "foo", "bar" etc keys are not fixed. They could be "A","B" etc

#

Effectively I think I want a recursrive Record<string,string | Record<string,string|Record ...

civic prairie
#

alright

civic prairie
#

I guess?

warm monolith
#

😵‍💫