spring boot 使用tomcat服务器
PUT请求 Body中多了一个字段 会有明确的提示
{
"code": 400,
"error": "Bad Request",
"message": "Could not read document: Unrecognized field \"id\" (class com.XXX), not marked as ignorable (8 known properties: ...])\n at [Source: java.io.PushbackInputStream@51c5845a; line: 2, column: 12] (through reference chain: com.XXX[\"id\"]); nested exception is com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field \"id\" (class com.XXX), not marked as ignorable (8 known properties: ...])\n at [Source: java.io.PushbackInputStream@51c5845a; line: 2, column: 12] (through reference chain: com.XXX[\"id\"])",
"exception": "org.springframework.http.converter.HttpMessageNotReadableException"
}
表示请求Json中多了一个id属性。
但若用Jettty的话 只有如下提示(swagger ui界面中)
如果是POST请求的话 会是如下的输出
{
"code": 400,
"error": "Bad Request",
"message": "Bad Request",
"exception": "org.springframework.http.converter.HttpMessageNotReadableException"}
但仍不知道具体的错误原因 如多了哪个属性
可见Jetty对PUT方法支持的也不是很好