Postman传递Josn字段报错:Cannot deserialize instance of `java.util.ArrayList` out o

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 o

    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”,…]”就行,如下图所示:

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

上一篇:【Mac】安装好maven后输入 mvn --version 报错 “libjansi.jnilib” cannot be opened because the developer cannot be


下一篇:Python学习笔记:sklearn.externals.joblib导入报错cannot import name 'joblib'