springboot学习① 报错:JSON parse error: Unexpected character (‘l‘ (code 108)):

一般出现这种错误:

JSON parse error: Unexpected character ('l' (code 108)): was expecting double-quote to start field name; nested exception is com.fasterxml.jackson.core.JsonParseException: Unexpected character ('l' (code 108)): was expecting double-quote to start field name
 at [Source: (PushbackInputStream); line: 4, column: 6]]

原因是传过来的JSON格式写错了,属性值没打 “” 

springboot学习① 报错:JSON parse error: Unexpected character (‘l‘ (code 108)):_第1张图片

{
	"labelType":"123",
    labelName:"2999",
	labelObject:1
}

需要改成

springboot学习① 报错:JSON parse error: Unexpected character (‘l‘ (code 108)):_第2张图片 

{
	
	"labelType":"123",
    "labelName":"2999",
	"labelObject":1
}

还有一种可能是因为:

最后一个多加了个逗号“,”

springboot学习① 报错:JSON parse error: Unexpected character (‘l‘ (code 108)):_第3张图片

{
	
	"labelType":"123",
    "labelName":"2999",
	"labelObject":1,
}

 去掉即可

springboot学习① 报错:JSON parse error: Unexpected character (‘l‘ (code 108)):_第4张图片

 

{
	
	"labelType":"123",
    "labelName":"2999",
	"labelObject":1
}

总结

慢慢学,很多东西还是要实际操作才知道有很多坑,光看的确不行。还是想吐槽,分组写真的是三个人三种代码风格,我再来就是4种了,

你可能感兴趣的:(springboot)