Skip to content

How to deal with Structs? #243

Answered by timostamm
mirkolenz asked this question in Q&A
Discussion options

You must be logged in to vote

Hi Mirko, you are correct, we're representing Struct exactly like it's defined in it's proto source.

I agree it is terrible to use 😆

However, Struct maps perfectly to a JSON object (and our JsonObject type), so you can do:

Struct.fromJson({
  "foo": "you can put any JSON here",
  "bar": 123,
});

Does that help?

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mirkolenz
Comment options

Answer selected by mirkolenz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants