You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public class CommonReq {
private String name;
private Integer type;
}
http请求传递的body如下:
{
"name": "jedrek",
"type": "hard"
}
报错信息如下:
{
"message": "Parameter is not valid for operation [xxx]. Parameter is [commonReq]. Processor is [body]. Message is [Cannot deserialize value of type java.lang.Integer from String "hard": not a valid java.lang.Integer value\n at [Source: (org.apache.servicecomb.foundation.vertx.stream.BufferInputStream); line: 3, column: 13] (through reference chain: CommonReq["type"])]."
}
背景
当 接口调用传递的body跟接口定位的入参不一致时,接口返回的message信息存在内部代码结构和行号等信息
复现demo
接口入参定义如下:
http请求传递的body如下:
报错信息如下:
{
"message": "Parameter is not valid for operation [xxx]. Parameter is [commonReq]. Processor is [body]. Message is [Cannot deserialize value of type
java.lang.Integer
from String "hard": not a validjava.lang.Integer
value\n at [Source: (org.apache.servicecomb.foundation.vertx.stream.BufferInputStream); line: 3, column: 13] (through reference chain: CommonReq["type"])]."}
这个打印信息感觉存在安全问题,暴露了接口的内部实现,可否针对于这种场景,对打印的异常message进行调整
The text was updated successfully, but these errors were encountered: