HttpMessageNotReadableException: json参数格式错误bug3

统一异常捕获 

postman测试 从word文档下直接粘贴json 出现这个问题

org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Unexpected character (' ' (code 160)): was expecting double-quote to start field name; nested exception is com.fasterxml.jackson.core.JsonParseException: Unexpected character (' ' (code 160)): was expecting double-quote to start field name

如何解决

json:

{

        "a": 1,

        "b":2

}

如果直接粘贴, 参数前面变成一个空格, 格式出现了问题

删除前面空格 然后tab 重新发送 则成功!!!

你可能感兴趣的:(#,异常总结分类,json,postman,测试工具)