We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
版本: fastjson-version 1.2.83 接口描述: curl --location --request POST 'http://localhost:8080/fj' \ --header 'Content-Type: application/json' \ --data-raw '{ "auditStatus": "1", "message": "这是审批意见啊", "ids": [63] }' 接口定义的参数ids是集合形式,但是前端错误传递了数字类型,发现两种不同的入参顺序,出现了不同的结果 调用参数一: {"auditStatus":"1","message":"这是审批意见啊","ids":63} 接口正常响应,fastjson将ids的入参处理成了数组,故接口无报错。 调用参数二: {"auditStatus":"1","ids":63,"message":"这是审批意见啊"} 调整了顺序,此时接口报错,提示: com.alibaba.fastjson.JSONException: syntax error, expect {, actual int, pos 25, fastjson-version 1.2.83
curl --location --request POST 'http://localhost:8080/fj' \ --header 'Content-Type: application/json' \ --data-raw '{ "auditStatus": "1", "message": "这是审批意见啊", "ids": [63] }'
{"auditStatus":"1","message":"这是审批意见啊","ids":63}
{"auditStatus":"1","ids":63,"message":"这是审批意见啊"}
com.alibaba.fastjson.JSONException: syntax error, expect {, actual int, pos 25, fastjson-version 1.2.83
调试了源码,发现了这点区别 参数一: 参数二:
在 JavaBeanDeserializer.deserialze()方法中,当 token=2时,某些情况会触发以下代码 导致最终出现异常。
JavaBeanDeserializer.deserialze()
感觉有点奇怪, public <T> T deserialze(DefaultJSONParser parser, Type type, Object fieldName) { return deserialze(parser, type, fieldName, 0); } 在调用这个方法时,没debug下去。
public <T> T deserialze(DefaultJSONParser parser, Type type, Object fieldName) { return deserialze(parser, type, fieldName, 0); }
The text was updated successfully, but these errors were encountered:
和这个 #4127 有关系吗
Sorry, something went wrong.
No branches or pull requests
版本:
fastjson-version 1.2.83
接口描述:
curl --location --request POST 'http://localhost:8080/fj' \ --header 'Content-Type: application/json' \ --data-raw '{ "auditStatus": "1", "message": "这是审批意见啊", "ids": [63] }'
接口定义的参数ids是集合形式,但是前端错误传递了数字类型,发现两种不同的入参顺序,出现了不同的结果
调用参数一:
{"auditStatus":"1","message":"这是审批意见啊","ids":63}
接口正常响应,fastjson将ids的入参处理成了数组,故接口无报错。
调用参数二:
{"auditStatus":"1","ids":63,"message":"这是审批意见啊"}
调整了顺序,此时接口报错,提示:
com.alibaba.fastjson.JSONException: syntax error, expect {, actual int, pos 25, fastjson-version 1.2.83
调试了源码,发现了这点区别
参数一:
参数二:
在
JavaBeanDeserializer.deserialze()
方法中,当 token=2时,某些情况会触发以下代码导致最终出现异常。
感觉有点奇怪,
public <T> T deserialze(DefaultJSONParser parser, Type type, Object fieldName) { return deserialze(parser, type, fieldName, 0); }
在调用这个方法时,没debug下去。
The text was updated successfully, but these errors were encountered: