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
询问有关本项目的使用和其他方面的相关问题。
老项目中有些bean字段命名不规范,有些字段名首字母大写,在fastjson 1.x版本中会生成首字母大写和首字母小写两个字段,在fastjson2.x版本中则只生成首字母小写字段,请问下在fastjson2.x版本有什么方法可以保持一致
public class JsonTest { public String JsonName; public String getJsonName() { return JsonName; } public void setJsonName(String jsonName) { JsonName = jsonName; } public static void main(String[] args) { JsonTest jsonTest = new JsonTest(); jsonTest.setJsonName("test"); String jsonString = JSONObject.toJSONString(jsonTest); System.out.println(jsonString); } }
fastjson 1.2.83:
fastjson 2.0.48:
The text was updated successfully, but these errors were encountered:
fastjson 2.x的行为更合理啊
Sorry, something went wrong.
是的,fastjson2.x更规范,主要是历史遗留问题,涉及的地方有太多...所以想了解下,除了使用@JSONField注解解决,fastjson2.x有提供其他方法可以改造解决吗
No branches or pull requests
询问有关本项目的使用和其他方面的相关问题。
问题描述
老项目中有些bean字段命名不规范,有些字段名首字母大写,在fastjson 1.x版本中会生成首字母大写和首字母小写两个字段,在fastjson2.x版本中则只生成首字母小写字段,请问下在fastjson2.x版本有什么方法可以保持一致
重现步骤
打印结果
fastjson 1.2.83:
fastjson 2.0.48:
The text was updated successfully, but these errors were encountered: