Json Provider should not flatten structure
See original GitHub issuehi, I’m playing around with cfg4j and as we’re using JSON in our current setup I’d like to continue using it. However, much of the point of using json is lost if you can’t use arrays and objects (and arrays of objects) - particularly when the flattening produces strange results - e.g.
"key": [{"innerKey": "value"}]
fattens to just “key”: “value”
is there a particular reason why structures are flattened? The consumer of the configuration can be expected to know about the general structure of the configuration, no?
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Why and when do we need to flatten JSON objects?
In all cases where the JSON represents an object structure that I've combined manually, I expect it not to change. So flattening something ......
Read more >Flattening a JSON Object So It's Queryable Using Rockset
You will often need to flatten a JSON object so you can query it. In this post, we'll show how to do so...
Read more >Data Flattening and Data Unflattening | Firebolt Gloassary
Data flattening usually refers to the act of flattening semi-structured data, such as name-value pairs in JSON, into separate columns where the name...
Read more >Flatten To JSON Function - NI - National Instruments
JSON string is the flattened data encoded in UTF-8. UTF-8 encoded strings may not display correctly in LabVIEW controls.
Read more >flatten - Functions - Configuration Language | Terraform
Indirectly-nested lists, such as those in maps, are not flattened. ... we must first flatten the structure to produce a collection where each...
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
sure, this is the one i’ve been using:
thanks!
You could enforce a convention in a java properties file to represent arrays or objects. The example above can be written as
Am prefixing the number with
$
to safe guard against user input that make use of numeric keys. You can also provide aCf4gProperties
class which extendsProperties
to facilitates retrieving the nested values.