通过json插入coffee的接口一直报错,不知是什么情况:
传入的json是这样的:{"name":"摩卡","price":"5000"}
{
"timestamp": "2019-12-28T12:25:36.737+0800",
"status": 400,
"error": "Bad Request",
"message": "JSON parse error: Current token (VALUE_STRING) not numeric, can not use numeric value accessors; nested exception is com.fasterxml.jackson.databind.JsonMappingException: Current token (VALUE_STRING) not numeric, can not use numeric value accessors\n at [Source: (PushbackInputStream); line: 1, column: 26] (through reference chain: com.example.springbuckswaiter.controller.request.NewCoffeeRequest[\"price\"])",
"path": "/coffee/"
}
展开
作者回复: 试试把价格内容的引号去掉,比如 {"name":"摩卡","price":5000}