alibaba / alibaba/fastjson2

[QUESTION] 序列化问题可以不兼容 @JsonFormat 吗

Open
#1,456 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

### 请描述您的问题
*询问有关本项目的使用和其他方面的相关问题。*
```
@Data
public class UserVO {
@JsonFormat(pattern = "dd/MM/yyyy")
private Date date;
}

@Data
public class User {
private Date date;
}
```

JSON.parseObject(JSON.toJSONString(UserVO ), User.class);
反序列化使用 JSONReader.Feature.SupportSmartMatch 来不兼容 @JsonFormat
序列化可以支持不兼容 @JsonFormat吗

Contributor guide

Open the contributing guide

Research direction

Start with the UserVO and User examples in the issue and reproduce the JSON.toJSONString/User conversion using the stated @JsonFormat pattern and JSONReader.Feature.SupportSmartMatch setting. Determine whether serialization can ignore @JsonFormat, then document the supported behavior or the required change; no source file or test is named.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.