-
Notifications
You must be signed in to change notification settings - Fork 511
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[BUG] 使用WriteClassName序列化,然后再反序列化时@type信息没有去除 #2623
Comments
可以通过开启SupportAutoType避免反序列化后携带@type字段
|
2.0.x如果不配置SupportAutoType,就不会做任何相关处理,这个是为了安全考虑。 |
好的,请问开启SupportAutoType这个功能是在哪一个版本添加上去的,我使用fastjson2.0.13版本加上SupportAutoType后@type仍然没有去除 |
另外我发现一个问题,如果序列化对象是java.sql.Date时,使用上述接口会报错
报错日志如下 |
问题描述
使用序列化方法JSON.toJSONString(dataMap, SerializerFeature.WriteClassName),反序列话后的对象中包含@type信息,理想情况下应该不会出现@type(fastjson1反序列化后没有@type)
环境信息
重现步骤
期待的正确结果
期望的输出结果(使用fastjson1.2.68)
![image](https://private-user-images.githubusercontent.com/37527269/333238072-b61a3477-f737-4daf-b294-ba6311a75f16.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2MDE2NjYsIm5iZiI6MTczOTYwMTM2NiwicGF0aCI6Ii8zNzUyNzI2OS8zMzMyMzgwNzItYjYxYTM0NzctZjczNy00ZGFmLWIyOTQtYmE2MzExYTc1ZjE2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDA2MzYwNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTQ4MWQ5OTk0OTkxMTc1MjhjZGM2MmI1M2VhMDM2ZmMxMzBlYzg4Y2Q4MzZjMmFhY2EzZTljMWQ4OWU5N2M2NzMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.wiEPhZd15ZC0nN9kPTXR0Ax0jovwDcCuF6Wb7rM8jjo)
相关日志输出
The text was updated successfully, but these errors were encountered: