Flatten a nested json object

后端 未结 2 754
清歌不尽
清歌不尽 2020-12-29 15:28

I\'m looking for a method that will flatten a \"json\" hash into a flattened hash but keep the path information in the flattened keys. For example:

h = {\"a\         


        
2条回答
  •  北荒
    北荒 (楼主)
    2020-12-29 16:29

    I'm having a similar question and raised it here Best way to produce a flattened JSON (denormalize) out of hierarchical JSON in Ruby with a possible solution

    Is my solution an optimal one or is there any better way?

提交回复
热议问题