0
votes

My input JSON is as below.

{
  "identifier": "0134",
  "language": "EN",
  "questType": "JSQ",
  "questionHtml": "<div></div>"
}

And the expected output is

{
  "0134":{
  "identifier": "0134",
  "language": "EN",
  "questType": "JSQ",
  "questionHtml": "<div></div>"
  }
}

How can I achieve this using JOLT transformation?

1

1 Answers

0
votes

This spec should work for you:

[
  {
    "operation": "shift",
    "spec": {
      "*": "@(1,identifier).&"
    }
  }
]

See @ wildcard docs

Tested with https://jolt-demo.appspot.com/