[BUG] JSONType注解在Android Kotlin 数据类上不起作用
- Dominant language
- Java
- Stars
- 4.4k
- Forks
- 613
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 6
Description
### 问题描述
```
@JSONType(ignores = ["ref"])
data class Person(
var brand: Int = 0,
var cId: Long = 0,
var ref: Int = 0,
)
val result = JSON.toJSONString(person)
```
使用JSONType注解忽略ref字段的序列化和反序列化失效。ref字段仍然会被序列化。
### 环境信息
- OS信息: Xiaomi Pad 5 Pro 5G (Android 11)
- JDK信息:JetBrains Runtime version 17.0.9
- 版本信息:Fastjson2 2.0.51.android5
### 期待的正确结果
希望ref字段不会被序列化出来。
Contributor guide
Research direction
Start with the Kotlin data-class example in this issue and reproduce the behavior using JSON.toJSONString with Fastjson2 2.0.51.android5. Trace how JSONType ignores are handled for Android Kotlin properties, then add or update a regression test showing that ref is omitted during serialization and deserialization.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java, kotlin
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100