发布
社区首页 >问答首页 >jolt中使用if条件判断,如何写spec?

jolt中使用if条件判断,如何写spec?

提问于 2025-01-10 18:06:03
回答 0关注 0查看 19
代码语言:txt
复制
{
  "accounts": [
    {
      "title": "Testing account",
      "owner": {
        "id": "627637",
        "shortName": "bo name"
      },
      "type": "CA",
      "swiftCode": "SCBLBHBMXXX",
      "iban": "789",
      "bank": "STANDARD CHARTERED BANK",
      "accountNumber": "0018902867608",
      "currency": "BHD",
      "openingDate": "2024-10-15",
      "closingDate": "2020-12-01",
      "accountStatus": "O",
      "addressDetails": {
        "line1": "Test",
        "line3": "BAHRAIN"
      }
    }
  ]
}

当data.account.account.identification和data.account.servicer.identification没有值的时候期待输出

代码语言:txt
复制
{
  "Data" : {
    "Account" : [   
	{
      "AccountType" : "Business",
      "Account" : [ {
        "Name" : "bo name"
      } ],
      "AccountId" : "0018902867608",
      "Status" : "Enabled",
      "Currency" : "BHD",
      "AccountSubType" : "CurrentAccount",
      "Nickname" : "Testing account",
      "OpeningDate" : "2024-10-15T00:00:00+03:00",
      "MaturityDate" : "2020-12-01T00:00:00+03:00",
      "Servicer" : {
      }
    } 
	]
  }
}

当data.account.account.identification和data.account.servicer.identification有值的时候期待输出

代码语言:txt
复制
{
  "Data" : {
    "Account" : [   
	{
      "AccountType" : "Business",
      "Account" : [ {
	    "SchemeName":"BH.OBF.IBAN", 
        "Identification" : "789",
        "Name" : "bo name"
      } ],
      "AccountId" : "0018902867608",
      "Status" : "Enabled",
      "Currency" : "BHD",
      "AccountSubType" : "CurrentAccount",
      "Nickname" : "Testing account",
      "OpeningDate" : "2024-10-15T00:00:00+03:00",
      "MaturityDate" : "2020-12-01T00:00:00+03:00",
      "Servicer" : {
	    "SchemeName":"BH.OBF.BICFI", 
        "Identification" : "SCBLBHBMXXX"
      }
    } 
	]
  }
}

回答

和开发者交流更多问题细节吧,去 写回答
相关文章

相似问题

相关问答用户
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档