Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

236
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda