You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In 2.16.1, annotations for skipping null values on jvm records are ignored. Works in 2.15.2.
@JvmRecord
data classAnnotatedRecordClass (
@JsonInclude(JsonInclude.Include.NON_NULL)
valomitFieldIfNull:String?,
valstandardField:String?
)
Test
@Test
fun`omits null fields of jvm record classes if annotated as such`() {
val objectMapper = createObjectMapper()
val o =AnnotatedRecordClass(null, null)
val json = objectMapper.writeValueAsString(o)
assertEquals("""{"standardField":null}""", json)
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
In 2.16.1, annotations for skipping null values on jvm records are ignored. Works in 2.15.2.
Test
Beta Was this translation helpful? Give feedback.
All reactions