alibaba / alibaba/fastjson2

[FEATURE]考虑增加一个JSON.toJSONString(bean, context, Feature)函数

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

Description

### 请描述您的需求或者改进建议
context作为全局配置,后面的feature只是作为单次的配置,譬如有时候需要对json进行格式化,就可以这样使用
JSON.toJSONString(bean, context, JSONWriter.Feature.PrettyFormat);

### 请描述你建议的实现方案

### 描述您考虑过的替代方案

#### 附加信息

Contributor guide

Open the contributing guide

Research direction

Start by inspecting the existing JSON.toJSONString overloads and JSONWriter.Feature handling. Add the requested overload accepting a bean, context, and feature, then verify that a per-call feature such as PrettyFormat works while the context remains the global configuration; add or update tests for this behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
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.