alibaba / alibaba/fastjson2

JSONWriter.Feature.WriteLongAsString会把Integer类型的值转为字符串

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

### 请描述您的问题
依赖:fastjson2-extension-spring6
版本:2.0.52
问题:使用JSONWriter.Feature.WriteLongAsString的过程中发现会把Integer类型的值也给转为字符串,但按方法名来看 不是把Long类型的值转为String吗

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the behavior in the fastjson2-extension-spring6 dependency at version 2.0.52 with JSONWriter.Feature.WriteLongAsString. Check the serialization output for Integer and Long values; done means Integer remains numeric while Long is serialized as a string, with regression coverage added for both cases.

Written by the indexing model from the issue text.

Assessment

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