JSON parse error: Cannot deserialize instance of ...

created at 12-08-2021 views: 1

ERROR

JSON parse error: Cannot deserialize instance of `cn.bywin.pcldata.common.base.model.quality.RuleConfigDo` out of START_ARRAY token; nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of `cn.bywin.pcldata.common.base.model.quality.RuleConfigDo` out of START_ARRAY token\n at [Source: (PushbackInputStream); line: 1, column: 1]

Reason & Solution

I have encountered it twice in a row, and I may encounter it in the future. Let me take it down with my notes.

JSON parsing error, try to check the value returned by the front end, this time I encountered [{dataList}] and {dataList} which does not require [], in the form of an array and in the form of an object

When refactoring the original project, I did not look into this part too deeply. It is easy to slow down the progress by not communicating with the front end in time in some return situations.

created at:12-08-2021
edited at: 12-08-2021: