no String-argument constructor/factory method to deserialize from String value ||MismatchedInputExce

错误信息:

JSON parse error: Cannot construct instance of com.xxx.freight.waybill.api.Ao.PassengerPayNotifyAo (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value (’{“userId”:333,“businessType”:20,“payChannelType”:5,“orderId”:“101200440303471”,“payType”:11,“orderPrice”:1,“tradeNo”:“20201110022015281”,“outTradeNo”:“20201110022015281”,“appId”:“jdjr111436355003”,“buyerLogonId”:“111436355003”,“payTime”:“2020-11-10 15:55:44”,“sign”:“73199e05d6aa35e22f6a05acb8c83102”}’); nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct instance of com.xxx.freight.waybill.api.Ao.PassengerPayNotifyAo (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value (’{“userId”:333,“businessType”:20,“payChannelType”:5,“orderId”:“101200440303471”,“payType”:11,“orderPrice”:1,“tradeNo”:“20201110022015281”,“outTradeNo”:“20201110022015281”,“appId”:“jdjr111436355003”,“buyerLogonId”:“111436355003”,“payTime”:“2020-11-10 15:55:44”,“sign”:“73199e05d6aa35e22f6a05acb8c83102”}’)

问题原因:
调用端(前端或其他端),转了两次json。最后使数据变成了string而非json string导致的。

解决方法:如果自己postman进行post json 是可以的话 那就调用端处理就可以了。不过大概率是调用端处理 因为这是数据问题,不是自己写的代码问题

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值