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
不启用BrowserCompatible,List丢失精度,使用ValueFilter来处理,但ListSerializer无视ValueFilter。 BrowserCompatible做的事太多了,影响性能。
The text was updated successfully, but these errors were encountered:
为啥List会丢失精度?
Sorry, something went wrong.
抱歉,说得太简略了,是返回给前端使用的。 writeLong的判断是 if ((isEnabled(SerializerFeature.BrowserCompatible)) && (!isEnabled(SerializerFeature.WriteClassName))) 开始启用了BrowserCompatible,发现2.6M的String to JSON用了37秒,而关闭BrowserCompatible只需要几百毫秒;而且BrowserCompatible的中文转码我也不需要。 所以关闭BrowserCompatible使用ValueFilter来自己处理,但ValueFilter/NameFilter似乎是Map专用的, JSON.toJSONString(object,new ValueFilter() { // Write Number as String @OverRide public Object process(Object object, String name, Object value) { if(value instanceof Number && !(value instanceof Integer)){ return String.valueOf(value); } return value; } },SerializerFeature.DisableCircularReferenceDetect, // SerializerFeature.BrowserCompatible, SerializerFeature.WriteDateUseDateFormat, SerializerFeature.WriteMapNullValue); }
No branches or pull requests
不启用BrowserCompatible,List丢失精度,使用ValueFilter来处理,但ListSerializer无视ValueFilter。
BrowserCompatible做的事太多了,影响性能。
The text was updated successfully, but these errors were encountered: