alibaba / alibaba/fastjson2

[QUESTION]开启safemode后,序列化包含WriteClassName,生成结果中包含@type,AutoType仍有效

Open
#3,187 0 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
Java
Stars
4.4k
Forks
613
Avg merge
1d 22h
Merged PRs (30d)
6

Description

开启safemode=true后,使用JSON.toJSONString序列化时包含JSONWriter.Feature.WriteClassName,生成结果中包含@type,AutoType仍有效。但是在反序列化时,因开启safemode,导致JSONReader.Feature.SupportAutoType不生效,请问是否这种情况下,反序列化该如何处理呢

Contributor guide

Open the contributing guide

Research direction

Start with the JSON.toJSONString serialization using JSONWriter.Feature.WriteClassName, then trace the corresponding deserialization behavior with JSONReader.Feature.SupportAutoType while safemode=true. Done would require a maintainer-confirmed explanation of whether this combination is supported and, if not, a clearly scoped change or documented handling.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend-api-design
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.