如何使用Jolt转换创建从json到json转换的jolt规范?我正在使用Jolt工具测试json规范: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","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": "139102"
}
]
},"garantor" : {
"legalEntityName": [
{
"source": "figi2","value": "139102"
}
]
}
}
}
我需要创建一个json规范,到目前为止,我已经创建了一个json规范,但是我无法取得进展并到达最终输出:
"operation": "shift","spec": {
"instrumentRelations": {
"*": {
"refData": "instrument.Underlyings[].instruments"
}
},"*": "instrument.&"
}
}
]