正如我在文档中读到的:
// (i.e. not include in JSON output; or being set even if they were included)
\@JsonIgnoreProperties({ "internalId", "secretKey" })
// To ignore any unknown properties in JSON input without exception:
\@JsonIgnoreProperties(ignoreUnknown=true)
但是我怎样才能忽略未知和给定的
最佳答案
假设我正确理解了您的意思,您可以将您想要的条件组合到同一个注释中:
@JsonIgnoreProperties(value = { "internalId", "secretKey" }, ignoreUnknown = true)
关于java - 忽略 jackson I/O 序列化中的字段并忽略未知字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24549458/