Able to parse/deserialize dynamic keys or field
See original GitHub issueWhat is your use-case and why do you need this feature? I want to build a dynamic UI based on JSON Schema here: https://rjsf-team.github.io/react-jsonschema-form/
Does it currently possible to parse dynamic key like this?
"properties": {
"firstName": {
"type": "string",
"title": "First name",
"default": "Chuck"
},
"telephone": {
"type": "string",
"title": "Telephone",
"minLength": 10
},
3: {
"type": "string",
"title": "Telephone",
"minLength": 10
}
}
Describe the solution you’d like Is this the possible to do it like this?
data class MyJsonSchema(
val properties: Map<Any, MyDefaultProperties>
)
Issue Analytics
- State:
- Created 3 years ago
- Reactions:8
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Parse (Deserialize) JSON with dynamic keys (C#)
you don't need to deserialize, you can parse var jsonParsed=JObject.Parse(json); string[] previewNames= ((JArray)jsonParsed["objects"]) .
Read more >How to Deserialize JSON Into Dynamic Object in C# - Code ...
Describe how to deserialize JSON into dynamic object in C# with detail explanation and examples using native and Newtonsoft library.
Read more >apex - Way to parse JSON object with dynamic number of fields
I don't think it can be converted to an apex object in your case.won't JSON.deserializeUntyped() to iterate result section data as key-value ...
Read more >How to parse Dynamic JSON String? - Numpy Ninja
You will see the key-value pair of "key1" as a JavaScript Object property in the above JSON. In the real world, the JSON...
Read more >Android parse JSON Key dynamically | by Marwa Eltayeb
JSON stands for JavaScript Object Notation. It is an independent data exchange format and is the best alternative for XML. As a refresher,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
JsonElement.jsonObject
returnsJsonObject
which is aMap<String, JsonElement>
— you can convert recursively. You can also search for hints in this thread: https://github.com/Kotlin/kotlinx.serialization/issues/746@mochadwi It’s still better to use
JsonElement
thanMap<Any, ...>