We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@JSONField(deserialize = false) public int id; 如果属性是用【public】修饰的,反序列化【deserialize = false】不起作用。
请填写以下信息:
The text was updated successfully, but these errors were encountered:
add testcase for issue #3163
0f74507
import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.annotation.JSONField; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; public class Issue3163 { @Test public void test() { Bean bean = JSON.parseObject("{\"id\":1234}", Bean.class); assertEquals(0, bean.id); } public static class Bean { @JSONField(deserialize = false) public int id; } }
问题未重现
Sorry, something went wrong.
import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.annotation.JSONField; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; public class Issue3163 { @Test public void test() { Bean bean = JSON.parseObject("{\"id\":1234}", Bean.class); assertEquals(0, bean.id); } public static class Bean { @JSONField(deserialize = false) public int id; } } 问题未重现
如果属性id有set方法,是必须在set方法上面加【@JSONField(deserialize = false)】才能生效吗?
No branches or pull requests
问题描述
环境信息
请填写以下信息:
The text was updated successfully, but these errors were encountered: