alibaba / alibaba/fastjson2

[FEATURE] 为JSON.toJSON()添加format入参

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

Description

`JSON.toJSONString(obj, "millis") `可通过format入参控制Date类型输出为long类型。
但是`JSON.toJSON()`并没有这样的入参,期望也添加类似的入参能力

fastjson2版本:2.0.39

Contributor guide

Open the contributing guide

Research direction

Start by locating the implementations and existing tests for JSON.toJSON() and JSON.toJSONString(obj, "millis"). Trace how the format argument affects Date serialization, then add the corresponding JSON.toJSON() capability and tests showing the expected long output for the requested format.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.