Can Not Deserialize Instance of Java.util.arraylist Out of Start_object Token
Can not deserialize instance of coffee.util.ArrayList out of START_OBJECT token
It probably ways that there is a problem with the type conversion, and the data from the front end finish cannot be converted into the format I received.
I checked my ain interface first, and compared similar interfaces of other people. The same manner of writing, is it weird?
@ApiOperation(value = "Save", httpMethod = "POST") @RequestMapping(value ="/save",method = RequestMethod.Postal service) @ResponseBody public Consequence<String> saveTarget( @ApiParam("Salvage") @RequestBody List<TestDTO> testDTOS) { xxxService.relieve(testDTOS); return buildSuccessResult("Save successfully", zip); }
Let me debug and accept a wait. Okay, I got an mistake when I entered the parameters. The swagger interface debugging is inexplicably more than a pair of double quotes?
No way, I have to program for Goolge. I searched for this weblog. The large blood brother said:
I went to the front-end to eliminate the formatting problems, simply to no avail, I couldn't figure out why other people take interfaces but mine can't?
Subsequently tossing all morning, I had to ask for help
Finally, the big guy used the RestfulClient brought by IDEA to help me rule it out. My interface is okay, preliminary speculationSwagger version problem
All the same, the matter is not over yet, the forepart said that I e'er send you in json format, and you see that other interfaces are the same.Later on a few hours of wrangling, I turned to some other big homo.
He sees The swagger conversion format is always problematic, so I use the control prompt that comes with Windows to operate
Copy and paste the above Curl text editor to conform the format
coil -X Mail service --header "Content-Type: awarding/json" --header "Cookie: tracknick=admin; Souche-Security-Token=ZZZ1568006A_493c3f9589b3195316c7b419c252f4f2; _security_token=ZZZ1568006A_493c3f9589b3195316c7b419c123f4f2" --header "Accept: application/json" -d [{}] "http://local.xxx:8086/xxxAction/save"
And then re-create to the named window, something interesting happened, no mistake was reported!!!
The problem is farther locked, because the front end has an extra body!
body:[{ "age": 18, "sex": 0, "updatorId": "string" }]
The format passed from the normal front stop is like this:
[{ "age": 18, "sex": 0, "updatorId": "string" }]
Harm, in that location is an actress torso at the get-go, it is really a Japanese dog, and I tossed me for ii days.
Source: https://programmersought.com/article/36804636435/
0 Response to "Can Not Deserialize Instance of Java.util.arraylist Out of Start_object Token"
Enregistrer un commentaire