Как создать преобразование толчка c для преобразования json в json с использованием преобразования Джолта? Я использую инструмент встряхивания для проверки json spe c: http://jolt-demo.appspot.com/#inception
это мой ввод json:
"nameLong": [
{
"source": "trdse",
"value": "PDL Community Bancorp Ord Shs"
}
],
"instrumentRelations": [
{
"relationType": "Underlying",
"refData": {
"securities": [
{
"ric": [
{
"source": "trdse",
"errorCode": 103
}
],
"trQuoteId": [
{
"source": "trdse",
"errorCode": 103
}
]
}
]
}
}
],
"instrumentLegalEntityRelations": [
{
"relationType": "Issuer",
"refData": {
"legalEntityName": [
{
"source": "trdse",
"value": "Qatar Cinema and Film Distribution Co QSC"
}
],
"lei": [
{
"source": "trdse",
"errorCode": 103
}
],
"trIssuerOrgId": [
{
"source": "trdse",
"value": "139102"
}
]
}
},
{
"relationType": "garantor",
"refData": {
"legalEntityName": [
{
"source": "figi2",
"value": "qatar 2 "
}
],
"lei": [
{
"source": "figi2",
"errorCode": 103
}
],
"trIssuerOrgId": [
{
"source": "figi2",
"value": "139102"
}
]
}
}
]
}
Ожидаемый результат: :
"instrument" : {
"nameLong" : [ {
"source" : "trdse",
"value" : "PDL Community Bancorp Ord Shs"
} ],
"Underlyings" : [ {
"instruments" : {
"securities" : [ {
"ric" : [ {
"source" : "trdse",
"errorCode" : 103
} ],
"trQuoteId" : [ {
"source" : "trdse",
"errorCode" : 103
} ]
} ]
}
} ],
"Issuer" : {
"legalEntityName": [
{
"source": "trdse",
"value": "Qatar Cinema and Film Distribution Co QSC"
}
],
"lei": [
{
"source": "trdse",
"errorCode": 103
}
],
"trIssuerOrgId": [
{
"source": "trdse",
"value": "139102"
}
]
},
"garantor" : {
"legalEntityName": [
{
"source": "figi2",
"value": "qatar 2 "
}
],
"lei": [
{
"source": "figi2",
"errorCode": 103
}
],
"trIssuerOrgId": [
{
"source": "figi2",
"value": "139102"
}
]
}
}
}
Мне нужно создать json spe c, до сих пор я его создал, но не смог сделать проги и дойти до конечного результата:
"operation": "shift",
"spec": {
"instrumentRelations": {
"*": {
"refData": "instrument.Underlyings[].instruments"
}
},
"*": "instrument.&"
}
}
]