Post内容无法读取的报错如何解决

爱必应

[Python] 纯文本查看 复制代码

body ={ "formWid": wid1[0], "collectWid": wid1[1], "schoolTaskWid": schoolTaskWid_get, "form": [{ "wid": wid_01, "formWid": wid1[0], "fieldType": 2, "title": "22", "description": "", "minLength": 0, "sort": "1", "maxLength": "", "isRequired": 1, "imageCount": "", "hasOtherItems": 0, "colName": "field001", "value": "22", "fieldItems": [{ "itemWid": itemWid_01, "content": "22", "isOtherItems": 0, "contendExtend": "", "isSelected": "" }] }, { "wid": wid_02, "formWid": wid1[0], "fieldType": 2, "title": "233333", "description": "", "minLength": 0, "sort": "2", "maxLength": "", "isRequired": 1, "imageCount": "", "hasOtherItems": 0, "colName": "field002", "value": "22222", "fieldItems": [{ "itemWid": itemWid_02, "content": "222222", "isOtherItems": 0, "contendExtend": "", "isSelected": "" }] }, { "wid": wid_03, "formWid": wid1[0], "fieldType": 2, "title": "222222", "description": "222222", "minLength": 0, "sort": "3", "maxLength": "", "isRequired": 1, "imageCount": "", "hasOtherItems": 0, "colName": "field003", "value": "否", "fieldItems": [{ "itemWid": itemWid_03, "content": "否", "isOtherItems": 0, "contendExtend": "", "isSelected": "" }] }, { "wid": wid_04, "formWid": wid1[0], "fieldType": 2, "title": "222", "description": "2222", "minLength": 0, "sort": "4", "maxLength": "", "isRequired": 1, "imageCount": "", "hasOtherItems": 0, "colName": "field004", "value": "否", "fieldItems": [{ "itemWid": itemWid_04, "content": "否", "isOtherItems": 0, "contendExtend": "", "isSelected": "" }] }, { "wid": wid_05, "formWid": wid1[0], "fieldType": 1, "title": "222", "description": "", "minLength": 1, "sort": "5", "maxLength": 300, "isRequired": 0, "imageCount": -2, "hasOtherItems": 0, "colName": "field005", "value": "", "fieldItems": "", "area1": "", "area2": "", "area3": "" }, { "wid": wid_06, "formWid": wid1[0], "fieldType": 2, "title": "222", "description": "222", "minLength": 0, "sort": "6", "maxLength": "", "isRequired": 0, "imageCount": "", "hasOtherItems": 1, "colName": "field006", "value": "", "fieldItems": "" }, { "wid": wid_07, "formWid": wid1[0], "fieldType": 2, "title": "222", "description": "", "minLength": 0, "sort": "7", "maxLength": "", "isRequired": 0, "imageCount": "", "hasOtherItems": 0, "colName": "field007", "value": "", "fieldItems": "" }, { "wid": wid_08, "formWid": wid1[0], "fieldType": 2, "title": "222", "description": "", "minLength": 0, "sort": "8", "maxLength": "", "isRequired": 0, "imageCount": "", "hasOtherItems": 0, "colName": "field008", "value": "", "fieldItems": "" }, { "wid": wid_09, "formWid": wid1[0], "fieldType": 2, "title": "222", "description": "", "minLength": 0, "sort": "9", "maxLength": "", "isRequired": 0, "imageCount": "", "hasOtherItems": 0, "colName": "field009", "value": "", "fieldItems": "" }, { "wid": wid_10, "formWid": wid1[0], "fieldType": 2, "title": "2222", "description": "", "minLength": 0, "sort": "10", "maxLength": "", "isRequired": 0, "imageCount": "", "hasOtherItems": 0, "colName": "field010", "value": "", "fieldItems": "" }]}

其中wid1和wid3分别是从外部传入body的两个数组

post这段内容的时候报错如下:text = {"code":"-1","message":"Could not read document: Can not instantiate value of type [simple type, class com.wisedu.wec.coun.common.model.FieldItem] from String value (”); no single-String constructor/factory method\n at [Source: java.io.PushbackInputStream@147198f5; line: 1, column: 2897] (through reference chain: com.wisedu.wec.coun.common.model.FormSubmitRequest[\"form\"]->java.util.ArrayList[5]->com.wisedu.wec.coun.common.model.FormField[\"fieldItems\"]->java.util.ArrayList[0]); nested exception is com.fasterxml.jackson.databind.JsonMappingException: Can not instantiate value of type [simple type, class com.wisedu.wec.coun.common.model.FieldItem] from String value (”); no single-String constructor/factory method\n at [Source: java.io.PushbackInputStream@147198f5; line: 1, column: 2897] (through reference chain: com.wisedu.wec.coun.common.model.FormSubmitRequest[\"form\"]->java.util.ArrayList[5]->com.wisedu.wec.coun.common.model.FormField[\"fieldItems\"]->java.util.ArrayList[0])"}

看这个报错貌似是数组的错误,但是不知道怎么改

声明:本站所有资源均由网友分享,如有侵权内容,请在文章下方留言,本站会立即处理。

原文链接:,转发请注明来源!

发表评论