alibaba / fastjson2

🚄 FASTJSON2 is a Java JSON library with excellent performance.
Apache License 2.0
3.81k stars 498 forks source link

[BUG]无符号类型字段转成 json后字段名被修改了 #2978

Open lf7817 opened 2 months ago

lf7817 commented 2 months ago

问题描述

public data class TestData(
    val ms: ULong,
    val x: Float,
    val y: UInt,
)

被转成了

{"ms-s-VKNKU":1231111111,"x":1.0,"y-pVg5ArA":2}

环境信息

请填写以下信息:

重现步骤

println(TestData(1231111111u, 1.0f, 2u).toJSONString())

期待的正确结果

对您期望发生的结果进行清晰简洁的描述。

{"ms":1231111111,"x":1.0,"y":2}

相关日志输出

附加信息

lf7817 commented 2 months ago

用 jackson也是这样,gson是正确的