1

is this doable with JMESPath?

i want to transform this

{
  "common":  "value",  
  "subdicts": {
    "first": {"sub" : 10},
    "second": { "sub": 20}
  }
}

to

[
  {"common": "value",  "sub": 10}, 
  {"common": "value", "sub": 20}
]
laerus
  • 11
  • 3

1 Answers1

0

You can use it.

[
   {
      Common:common,
      Sub:subdicts.first.sub
   },
   {
      Common:common,
      Sub:subdicts.second.sub
   }
]

Result

[
  {
    "Common": "value",
    "Sub": 10
  },
  {
    "Common": "value",
    "Sub": 20
  }
]
Serkan Arslan
  • 13,158
  • 4
  • 29
  • 44