FasterXML / FasterXML/jackson-dataformats-text

Allow specifying custom String placeholder to use when a POJO would serialize as `Object`

未关闭
#13 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
csv
主要语言
Java
星标
455
派生
164
平均合并
6 天 10 小时
30 天内合并 PR
2

描述

(from https://github.com/FasterXML/jackson-dataformat-csv/issues/85 by @MattFriedmanAfilias)

When an object is encountered when writing CSV, the library throws an exception.

Problem: The model might be changed and an object field could be introduced. In this case, the developer will not necessarily update any tests to include the new field.

If that happens the error may only be detected at runtime. We want to detect such problems sooner, or avoid them altogether.

It should be possible to detect the error sooner, or to introduce a setting that would cause the exception to not be thrown and to provide instead some default behavior.

Such behavior might be to simply print "Object" or "n/a" when an object is encountered, rather than throwing an exception; a log message warning about this might be useful too.

The developer should be in control of this setting IMO. The library should make it possible for the developer to decide on the behavior rather than only throwing an exception for this scenario.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。