alibaba / alibaba/fastjson2

[QUESTION]在序列化的时候如何把 LocalDateTime 类型的null 输出为 空的字符串双引号?

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

LocalDateTime time=null;
序列化结果为:
{"time":null}
理想结果为:
{"time":""}
怎么能达到目的?

Contributor guide

Open the contributing guide

Research direction

The issue provides only a Java snippet and expected JSON output; no repository file, test, or entry point is named. Start by reproducing the LocalDateTime null serialization example and review fastjson2's Java serialization options. Done means identifying or documenting a supported way to serialize this null value as an empty string.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend-api-design
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.