Skip to content
New issue

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

FastJsonHttpMessageConverter有bug,非法json格式字符串仍可反序列化为Java对象 #4523

Open
mgyboom opened this issue Jul 26, 2024 · 1 comment

Comments

@mgyboom
Copy link

mgyboom commented Jul 26, 2024

fastjson版本 1.2.83 和 2.0.52
springboot版本 2.0.0.RELEASE
请求示例如下:

curl --location --request POST 'http://localhost:8089/test' \
--header 'Content-Type: application/json' \
--data '{
    "name": "jackson",
    "cards": [
        {
            "cardNumber": "123456",
            "bankName": "ICBC"
        }}
    ]
}'

注意cards数组的第一个元素对象后多了个}
预期springmvc会报HttpMessageNotReadableException,实际竟然解析通过了,但是cards中第二个元素为空对象。
1721988073556_4F934D7E-EDC2-4f3b-AEE0-2DCC658D9915

@kimmking
Copy link
Contributor

It seems a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants