0

can someone help with jolt spec .

input :

{
 "data": [
     {
     "key": "A,B,C,D,S"
     }
  ]
}

I want output like :

{
 "id":"A"
},
{
 "id":"B"
},
{
 "id":"C"
},
{
 "id":"D"
},
{
 "id":"S"
}

The key can be of n numbers of commaSeperated value . and I need n number of objects

Thanks in Advance .

Pratik Jaiswal
  • 390
  • 1
  • 5
  • 21

1 Answers1

0

Yes, but only with Jolt 0.1.1 which has a "split" function. However at this time the Jolt Demo site has not been updated to use it.

https://github.com/bazaarvoice/jolt/releases/tag/jolt-0.1.1

"split" unit test

https://github.com/bazaarvoice/jolt/blob/7812399d1c955742d81eae363244a2d0ef86cf3b/jolt-core/src/test/resources/json/modifier/functions/stringsSplitTest.json

Milo S
  • 4,466
  • 1
  • 19
  • 22