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
fastjson能不能添加一个容错机制,自动跳过数据类型不匹配的字段而不是抛异常 #854
Comments
能提供你遇到问题的testcase么?好让我实现之后能够满足你的需求 |
我觉得楼主的case应该是这样的
会抛出一下异常
但是这种抛出异常的机制是 fail-fast 的理念,也许可以添加一个 fail-fast 为 false 的选项? |
我也觉得容错机制是个不错的想法。这样在解析时,不会因为某一条数据的异常导致整个解析失败。 |
是的,类似Android 原生Json里的opt方法 |
以前我也提过同需求 #1227 |
@wenshao fastjson目前有WriteNullArrayAsEmpty这种属性了,所以希望加几个 WriteEmptyArrayAsNull 这样的属性,比忽略异常更管用,非常感谢。 |
我们目前是只能在JSON String转JavaBean前 |
这个问题还没解决吗? |
就是cyberdak说的那种情况,我看过你们的源码,虽然可以自己更改,but我觉得官方提供这种功能会更好一些
The text was updated successfully, but these errors were encountered: