alibaba / alibaba/fastjson2

[FEATURE] WriteNonStringValueAsString 不包括 boolean

Open
#2,669 2 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

### 请描述您的需求或者改进建议

从 https://github.com/alibaba/fastjson2/issues/2560 之后,boolean开始有双引号了。
希望WriteNonStringValueAsString按以下情况区分处理

* boolean - 不需要 AsString, `true`/`false` 很好
* number - 支持 AsString,尤其大数或小数精度。

或者,增加 `NumberAsString`,仅作用于`Number`及primitive(boolean除外)
jackson有`WRITE_NUMBERS_AS_STRINGS`这个选项。

Contributor guide

Open the contributing guide

Research direction

Start by tracing the WriteNonStringValueAsString option and review the behavior change described in issue 2560. Confirm the intended handling for boolean versus Number and verify that booleans remain unquoted while numbers can be serialized as strings, including large or fractional values.

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
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.