Extrair folhas do arquivo JSON com JSONpath
Eu tenho uma saída JSON de uma API REST e a saída é assim:
{
"sprints": [{
"id": 10516,
"sequence": 10516,
"name": "SP121 - BRK relief",
"state": "CLOSED",
"linkedPagesCount": 0
}, {
"id": 10447,
"sequence": 10447,
"name": "SP120 - Plannibal Smith",
"state": "CLOSED",
"linkedPagesCount": 0
}, {
"id": 10391,
"sequence": 10391,
"name": "SP119 - Don't bug or bend over",
"state": "CLOSED",
"linkedPagesCount": 0
}, {
"id": 10244,
"sequence": 10244,
"name": "SP118 - Be an all grounder!",
"state": "CLOSED",
"linkedPagesCount": 0
}, {
"id": 10183,
"sequence": 10183,
"name": "SP117 - The R Factor",
"state": "CLOSED",
"linkedPagesCount": 0
}, {
"id": 10182,
"sequence": 10182,
"name": "SP116 - Deliverfull",
"state": "CLOSED",
"linkedPagesCount": 0
}, {
"id": 10123,
"sequence": 10123,
"name": "SP115 - Appartemenneke",
"state": "CLOSED",
"linkedPagesCount": 0
}],
"velocityStatEntries": {
"10516": {
"estimated": {
"value": 10.0,
"text": "10.0"
},
"completed": {
"value": 7.5,
"text": "7.5"
}
},
"10244": {
"estimated": {
"value": 15.5,
"text": "15.5"
},
"completed": {
"value": 7.5,
"text": "7.5"
}
},
"10182": {
"estimated": {
"value": 12.0,
"text": "12.0"
},
"completed": {
"value": 10.0,
"text": "10.0"
}
},
"10391": {
"estimated": {
"value": 16.0,
"text": "16.0"
},
"completed": {
"value": 3.0,
"text": "3.0"
}
},
"10183": {
"estimated": {
"value": 12.0,
"text": "12.0"
},
"completed": {
"value": 7.0,
"text": "7.0"
}
},
"10123": {
"estimated": {
"value": 11.5,
"text": "11.5"
},
"completed": {
"value": 5.5,
"text": "5.5"
}
},
"10447": {
"estimated": {
"value": 7.0,
"text": "7.0"
},
"completed": {
"value": 3.0,
"text": "3.0"
}
}
}}
eu gostaria de extrair as folhas E as informações dentro das folhas de velocityStatEntries.
então a saída esperada seria esta:
sprint_id | estimado | 10516 concluído | 10.0 7,5 10244 | 15,5 | 7.5 etc.
o estranho é que, quando tento fazer isso através deste testador JSONpath on-line (jsonpath.curiousconcept.com/), obtenho o resultado esperado com uma consulta como esta "$ .velocityStatEntries". aí eu entendi:
[ {
"10516":{
"estimated":{
"value":10,
"text":"10.0"
},
"completed":{
"value":7.5,
"text":"7.5"
}
},
"10244":{
"estimated":{
"value":15.5,
"text":"15.5"
},
"completed":{
"value":7.5,
"text":"7.5"
}
},
"10182":{
"estimated":{
"value":12,
"text":"12.0"
},
"completed":{
"value":10,
"text":"10.0"
}
},
"10391":{
"estimated":{
"value":16,
"text":"16.0"
},
"completed":{
"value":3,
"text":"3.0"
}
},
"10183":{
"estimated":{
"value":12,
"text":"12.0"
},
"completed":{
"value":7,
"text":"7.0"
}
},
"10123":{
"estimated":{
"value":11.5,
"text":"11.5"
},
"completed":{
"value":5.5,
"text":"5.5"
}
},
"10447":{
"estimated":{
"value":7,
"text":"7.0"
},
"completed":{
"value":3,
"text":"3.0"
}
}}]
mas como estou usando o Talend Open Studio, tenho que inserir uma consulta Loop Jsonpath e especificar o mapeamento. alguém sabe como consertar isso no Talend? estou usando o componente tExtractJSONFields
EDIT: algumas capturas de tela adicionais para obter informações adicionais
Job1:
Saída1:
Não é possível postar mais telas porque não tenho pontos de reputação suficientes ... :(