Skip to content

Extraction as a JsonPrimitive / Find type of value for a key ? #207

Answered by russhwolf
Shabinder asked this question in Q&A
Discussion options

You must be logged in to vote

There's not really a good built-in for this, sorry. I explicitly left that behavior undefined to avoid the complication of massaging every platform API to have the same behavior since there's so many little edge-cases there.

If you know all possible keys and types explicitly, you can probably do something clever with the serialization extension to convert to json. But if you know that then you wouldn't need to iterate the way you are.

One option might be to store everything as strings, assuming you have the flexibility to change that.

Replies: 1 comment 1 reply

Comment options

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

Answer selected by Shabinder
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