Resolved [org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Unexpected character (’ ’ (code 160)): was expecting double-quote to start field name; nested exception is com.fasterxml.jackson.core.JsonParseException: Unexpected character (’ ’ (code 160)): was expecting double-quote to start field name
at [Source: (PushbackInputStream); line: 2, column: 3]]

肯定的原因之一:是json格式出错 :

我没对比这个 到底哪里格式错误了,只是重新拼写的

错误格式:

{
“transType”:“01”,
“cityCode”:“6413”,
“requestTime”:“20210425160902”,
“cardNo”:“6413000173060044”,
“cardBalance”:0,
“logicType”:“04”,
“orderAmount”:0.00,
“startMonth”:“202104”,
“endMonth”:“202204”,
“payNumber”:75,
“nowMonthBalance”:0,
“verifyCardData”:{
“cardBalance”:“00000000”,
“rondam”:“429CCBD0”,
“transSeq”:“0000”,
“mac1”:“44091D09”,
“psam”:“000000000000”
},
“numberDetails”:[
{
“monthBalance”:0,
“numberMonth”:“202104”,
“rechargeAmount”:0.00,
“rechargeNumber”:75
},
{
“monthBalance”:0,
“numberMonth”:“202105”,
“rechargeAmount”:0.00,
“rechargeNumber”:75
},
{
“monthBalance”:0,
“numberMonth”:“202106”,
“rechargeAmount”:0.00,
“rechargeNumber”:75
},
{
“monthBalance”:0,
“numberMonth”:“202107”,
“rechargeAmount”:0.00,
“rechargeNumber”:75
},
{
“monthBalance”:0,
“numberMonth”:“202108”,
“rechargeAmount”:0.00,
“rechargeNumber”:75
},
{
“monthBalance”:0,
“numberMonth”:“202109”,
“rechargeAmount”:0.00,
“rechargeNumber”:75
},
{
“monthBalance”:0,
“numberMonth”:“202110”,
“rechargeAmount”:0.00,
“rechargeNumber”:75
},
{
“monthBalance”:0,
“numberMonth”:“202111”,
“rechargeAmount”:0.00,
“rechargeNumber”:75
},
{
“monthBalance”:0,
“numberMonth”:“202112”,
“rechargeAmount”:0.00,
“rechargeNumber”:75
},
{
“monthBalance”:0,
“numberMonth”:“202201”,
“rechargeAmount”:0.00,
“rechargeNumber”:75
},
{
“monthBalance”:0,
“numberMonth”:“202202”,
“rechargeAmount”:0.00,
“rechargeNumber”:75
},
{
“monthBalance”:0,
“numberMonth”:“202203”,
“rechargeAmount”:0.00,
“rechargeNumber”:75
}]
}


正确格式:

{
“transType”: “01”,
“cityCode”: “6413”,
“requestTime”: “20210425160902”,
“cardNo”: “6413000173060044”,
“logicType”: “04”,
“orderAmount”: 0.00,
“startMonth”: “202104”,
“endMonth”: “202203”,
“payNumber”: 75,
“nowMonthBalance”: 0,
“verifyCardData”: {
“cardBalance”: “00000000”,
“rondam”: “429CCBD0”,
“transSeq”: “0000”,
“mac1”: “44091D09”,
“psam”: “000000000000”
},
“numberDetails”:[
{
“monthBalance”:0,
“numberMonth”:“202104”,
“rechargeAmount”:0.00,
“rechargeNumber”:75
},
{
“monthBalance”:0,
“numberMonth”:“202105”,
“rechargeAmount”:0.00,
“rechargeNumber”:75
},
{
“monthBalance”:0,
“numberMonth”:“202106”,
“rechargeAmount”:0.00,
“rechargeNumber”:75
},
{
“monthBalance”:0,
“numberMonth”:“202107”,
“rechargeAmount”:0.00,
“rechargeNumber”:75
},
{
“monthBalance”:0,
“numberMonth”:“202108”,
“rechargeAmount”:0.00,
“rechargeNumber”:75
},
{
“monthBalance”:0,
“numberMonth”:“202109”,
“rechargeAmount”:0.00,
“rechargeNumber”:75
},
{
“monthBalance”:0,
“numberMonth”:“202110”,
“rechargeAmount”:0.00,
“rechargeNumber”:75
},
{
“monthBalance”:0,
“numberMonth”:“202111”,
“rechargeAmount”:0.00,
“rechargeNumber”:75
},
{
“monthBalance”:0,
“numberMonth”:“202112”,
“rechargeAmount”:0.00,
“rechargeNumber”:75
},
{
“monthBalance”:0,
“numberMonth”:“202201”,
“rechargeAmount”:0.00,
“rechargeNumber”:75
},
{
“monthBalance”:0,
“numberMonth”:“202202”,
“rechargeAmount”:0.00,
“rechargeNumber”:75
},
{
“monthBalance”:0,
“numberMonth”:“202203”,
“rechargeAmount”:0.00,
“rechargeNumber”:75
}]
}

Json 格式:

{
  "cardNo": "6413000173060044",
  "random": "26F804D0"
}

list 集合格式:

"numberDetails":[
    {
        "monthBalance":0,
         "numberMonth":"202104",
          "rechargeAmount":0.00,
           "rechargeNumber":75           
        },
        {
        "monthBalance":0,
         "numberMonth":"202105",
          "rechargeAmount":0.00,
           "rechargeNumber":75           
        },
        {
        "monthBalance":0,
         "numberMonth":"202106",
          "rechargeAmount":0.00,
           "rechargeNumber":75           
        },
        {
        "monthBalance":0,
         "numberMonth":"202107",
          "rechargeAmount":0.00,
           "rechargeNumber":75           
        },
        {
        "monthBalance":0,
         "numberMonth":"202108",
          "rechargeAmount":0.00,
           "rechargeNumber":75           
        },
        {
        "monthBalance":0,
         "numberMonth":"202109",
          "rechargeAmount":0.00,
           "rechargeNumber":75           
        },
        {
        "monthBalance":0,
         "numberMonth":"202110",
          "rechargeAmount":0.00,
           "rechargeNumber":75           
        },
        {
        "monthBalance":0,
         "numberMonth":"202111",
          "rechargeAmount":0.00,
           "rechargeNumber":75           
        },
        {
        "monthBalance":0,
         "numberMonth":"202112",
          "rechargeAmount":0.00,
           "rechargeNumber":75           
        },
        {
        "monthBalance":0,
         "numberMonth":"202201",
          "rechargeAmount":0.00,
           "rechargeNumber":75           
        },
        {
        "monthBalance":0,
         "numberMonth":"202202",
          "rechargeAmount":0.00,
           "rechargeNumber":75           
        },
        {
        "monthBalance":0,
         "numberMonth":"202203",
          "rechargeAmount":0.00,
           "rechargeNumber":75           
        }]
}
GitHub 加速计划 / js / json
18
5
下载
适用于现代 C++ 的 JSON。
最近提交(Master分支:2 个月前 )
6be4e856 4 天前
663058e7 6 天前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐