Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

239
Views
Java Jolt: can't find proper spec for my transformation

I'm struggling with that Jolt transformation: Here is my input JSON

{
  "bloc1-1": {
    "bloc1-2": [
      {
        "key": "key1",
        "value": "value1-1"
      },
      {
        "key": "key2",
        "value": "value1-2"
      }
    ]
  },
  "bloc2-1": {
    "bloc2-2": [
      {
        "key": "key1",
        "value": "value2-1"
      },
      {
        "key": "key2",
        "value": "value2-2"
      },
      {
        "key": "key3",
        "value": "value2-3"
      }
    ]
  }
}

Here is what I'm expecting

{
  "bloc1-key1" : "value1-1",
  "bloc1-key2" : "value1-2",
  "bloc2-key1" : "value2-1",
  "bloc2-key2" : "value2-2",
  "bloc2-key3" : "value2-3"
}

I have tried the following spec, but I cannot figure out how to prefix the key in the RHS (the @ should be the first character)

[
  {
    "operation": "shift",
    "spec": {
      "*": {
        "*": {
          "*": {
            "value": "@(1,key)"
          }
        }
      }
    }
  }
]

and got that

{
  "key1" : [ "value1-1", "value2-1" ],
  "key2" : [ "value1-2", "value2-2" ],
  "key3" : "value2-3"
}

Any help would be appreciated

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!