Postman传递Josn字段报错:Cannot deserialize instance of `java.util.ArrayList<java.lang.Object>` out of VALUE_STRING token

Postman 传递 Josn 字段报错:Cannot deserialize instance of java.util.ArrayList<java.lang.Object> out of VALUE_STRING token

  • 问题:

    2021-08-02 10:15:07.816 ERROR 9796 --- [nio-8082-exec-6] c.y.c.b.e.GlobalExceptionHandler : /training/add : JSON parse error: Cannot deserialize instance of java.util.ArrayList<java.lang.Object> out of VALUE_STRING token; nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of java.util.ArrayList<java.lang.Object> out of VALUE_STRING token
    at [Source: (PushbackInputStream); line: 9, column: 20] (through reference chain: com.yun.cloud.gap.entity.request.record.EmployeeTrainingRequest["trainingUrls"])

  • 原因:此时在数据映射过程中,数据类型不兼容以致于在相互转化时出错。因此我们只需要修改为数组格式“[“值 1”,“值 2”,…]”就行,如下图所示:


__EOF__

  • 本文作者: 少年、游
  • 本文链接: https://www.cnblogs.com/horseweed/p/15088893.html
  • 关于博主: 评论和私信会在第一时间回复。或者直接私信我。
  • 版权声明: 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
  • 声援博主: 如果您觉得文章对您有帮助,可以点击文章右下角推荐一下。