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
把json字符串转换为实体对象时:用了Feature.InitStringFieldAsEmpty参数,在1.2.29版本之前可以给对象正确赋值,之后的版本就无法赋值了。 对象实体:
public class TestEntity { private String id; private String ddd; private String name; //get set }
测试main方法
public static void main(String[] args) { String jsonStr = "{id:\"ss\",ddd:\"sdfsd\",name:\"hh\"}"; TestEntity news = JSON.parseObject(jsonStr, TestEntity.class, Feature.InitStringFieldAsEmpty); System.out.println(news.toString()); }
The text was updated successfully, but these errors were encountered:
正确的json格式key必须带双引号
String jsonStr = "{\"id\":\"ss\",\"ddd\":\"sdfsd\",\"name\":\"hh\"}";
Sorry, something went wrong.
add testcase for issue #2387
820d639
No branches or pull requests
把json字符串转换为实体对象时:用了Feature.InitStringFieldAsEmpty参数,在1.2.29版本之前可以给对象正确赋值,之后的版本就无法赋值了。
对象实体:
测试main方法
The text was updated successfully, but these errors were encountered: