第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

使用 apache Velocity 進(jìn)行 JSON 到 JSON 轉(zhuǎn)換?有沒有更好的方法來編寫我在

使用 apache Velocity 進(jìn)行 JSON 到 JSON 轉(zhuǎn)換?有沒有更好的方法來編寫我在

慕的地8271018 2022-09-28 14:24:28
我正在使用apache速度進(jìn)行json轉(zhuǎn)換。下面是我的 json 字符串    {    "apiCode": "Payment Execution Service",    "name": "Initiate a payment",    "description": "Initiate a payment",    "request": {        "method": "POST",        "path": "/api/v1/payments",        "headers": [            {                "Corporate-ID": "apiKey"            },            {                "Content-Type": "application/json"            }        ],        "body": "{\n  \"beneficiaryInformation\" : {\n    \"destinationAccountIdentifier\" : \"string\",\n    \"destinationBankIdentifier\" : \"DEUTDEDB237\",\n    \"fullName\" : \"JASON SMITH\"\n  },\n  \"purposeOfPayment\" : \"Invoice Payment\",\n  \"remittanceInformation\" : \"Mantainance of Fixtures\",\n  \"remitterInformation\" : {\n    \"sourceAccountCurrency\" : \"EUR\",\n    \"sourceAccountIdentifier\" : \"string\",\n    \"sourceBankIdentifier\" : \"DEUTDEDBFRA\"\n  },\n  \"transferAmount\" : 1.5,\n  \"transferCurrency\" : \"EUR\",\n  \"transferDate\" : \"2015-07-20\",\n  \"transferType\" : \"SCTInst\",\n  \"uniqueRequestNo\" : \"string\"\n}"    },    "response": {        "status": 200,        "headers": [            {                "Content-Type": "application/json"            }        ],        "body": "{\n  \"requestReferenceNo\" : \"string\",\n  \"transactionStatus\" : {\n    \"bankReferenceNo\" : \"string\",\n    \"reasonCode\" : \"string\",\n    \"statusCode\" : \"string\"\n  }\n}"    },    "provider": "Payment Execution Service"}下面是我的 .vm 文件   {"provider": {    "name": "$arr[0].apiCode"},"consumer": {    "name": "$arr[0].provider"},"interactions": [#set($i = 0)#foreach($a in $arr) {        "description": "$a.description",        "request": {            "path": "$a.request.path",            "method": "$a.request.method",            "headers": $json.valueToString($a.request.headers),            "body": $json.valueToString($a.request.body)        },
查看完整描述

1 回答

?
ITMISS

TA貢獻(xiàn)1871條經(jīng)驗(yàn) 獲得超8個(gè)贊

問題出在以下行中:

JSONObject responseobj = new JSONObject(obj.get("response").toString());

你把 是作為字符串到 JSON 對象,這就是為什么它以這種方式工作。


查看完整回答
反對 回復(fù) 2022-09-28
  • 1 回答
  • 0 關(guān)注
  • 202 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)