Skip to content
New issue

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

吐槽一下第一次使用就报错 #36

Closed
942bc opened this issue Mar 3, 2017 · 1 comment
Closed

吐槽一下第一次使用就报错 #36

942bc opened this issue Mar 3, 2017 · 1 comment

Comments

@942bc
Copy link

942bc commented Mar 3, 2017

SysUserLogin sysUserLogin = new SysUserLogin();
sysUserLogin.setCreateTime(new Date());
sysUserLogin.setLoginName("测试一下");
System.out.println(JsonStream.serialize(sysUserLogin));

Exception in thread "main" com.jsoniter.spi.JsonException: com.jsoniter.spi.JsonException: com.jsoniter.spi.JsonException: getter name conflict: normalizedYear

把日期字段注释掉就可以了,但是中文又被转了
{"loginName":"\u6d4b\u8bd5\u4e00\u4e0b"}

本来想实现一个SpringMVC的messageConvert。试用了一下什么都设置,带Date类型的就直接报错,没有研究源码前还是不敢在项目中使用

@taowen
Copy link
Contributor

taowen commented Mar 3, 2017

你预期是什么?

  • Date默认不支持,没毛病啊,本来json也没有规范的序列化date的方式
  • getter 冲突也是因为有public的field和getter吧?贴出来看看
  • 中文默认转utf8,可以给一个不转的选项,之前没有这个需要。

@taowen taowen closed this as completed Mar 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants