Tagged articles
2 articles
Page 1 of 1
macrozheng
macrozheng
Feb 22, 2024 · Backend Development

Why Using isSuccess Can Break JSON Serialization in Java

This article explains how different Java JSON libraries handle boolean getter naming, shows code examples of serialization results with fastjson, Gson, and Jackson, and recommends using a plain "success" field with an isSuccess() getter to avoid runtime bugs.

GsonJacksonJavaBeans
0 likes · 7 min read
Why Using isSuccess Can Break JSON Serialization in Java
Top Architect
Top Architect
Jul 18, 2023 · Backend Development

Fastjson Boolean Property Naming Issue and How to Resolve It

This article explains why Fastjson incorrectly renames boolean fields prefixed with "is" during serialization, demonstrates the problem with sample Java code, analyzes the underlying reflection logic, and provides two practical solutions: following Alibaba Java guidelines or using @JSONField annotations.

boolean namingfastjsonjava
0 likes · 9 min read
Fastjson Boolean Property Naming Issue and How to Resolve It