提问人:lokesh 提问时间:10/24/2023 更新时间:10/24/2023 访问量:66
Jackson 对象映射器在 json 中添加了“stability”字段
Jackson object mapper adds "stability" field in json
问:
在序列化数据模型时,我获得了额外的字段“稳定性”。这是模型中未定义的内容。这仅在 Android 14 中发生,因此这似乎在 Android 14 以下的 API 中有效。
我在杰克逊版本上。2.13.3
这是我的模型的样子
@Parcelize
data class Address(
@JsonProperty("line1")
val line1: String,
@JsonProperty("line2")
val line2: String?,
@JsonProperty("city")
val city: String,
@JsonProperty("state")
val state: String,
@JsonProperty("postalCode")
val postalCode: String
) : Parcelable
我正在对模型进行序列化,如下所示
val jsonWrapper = ObjectMapper()
val stringValue = jsonWrapper.writeValueAsString(mockAddress)
stringValue
打印出来如下;
{"address":{"line1":"","line2":null,"city":"","state":"","postalCode":"","stability":0}
我找不到任何来自字段的参考。stability
我试过了.这似乎没有奏效。@JsonIgnoreProperties
@JsonPropertyOrder
感谢您的帮助!
答: 暂无答案
评论