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
I searched in the issues and found nothing similar.
I searched in the issues of databind and other modules used and found nothing similar.
I have confirmed that the problem only occurs when using Kotlin.
Describe the bug
here is a test that succeeds, which should not be possible since O.a is not nullable
importcom.fasterxml.jackson.module.kotlin.jacksonObjectMapperimportio.kotest.core.spec.style.StringSpecimportio.kotest.matchers.shouldBeclassO(vala:String)
classJsonTest : StringSpec({
val mapper = jacksonObjectMapper()
"test nulls are getting deserialized on non nullable type" {
val updates = mapper.readTree("""{"a":null}""")
val o = O("orig")
val newO = mapper.updateValue(o, updates)
newO.a shouldBe null
}
})
This is the behavior introduced by databind and is difficult (or should not be) fixed by kotlin-module.
I have left a comment on a similar problem in databind, so this issue is closed. FasterXML/jackson-databind#3079 (comment)
Search before asking
Describe the bug
here is a test that succeeds, which should not be possible since O.a is not nullable
To Reproduce
// Your code here
Expected behavior
the updateValue call should raise an error
Versions
Kotlin: 1.9.22
Jackson-module-kotlin: 2.15.3
Jackson-databind: 2.15.3
Additional context
No response
The text was updated successfully, but these errors were encountered: