<@UVAR0DXP0> <https://kotlinlang.slack.com/archive...
# spring
t
@Emil Kantis https://kotlinlang.slack.com/archives/C0B8ZTWE4/p1634020951040300?thread_ts=1633847081.037300&amp;cid=C0B8ZTWE4 interesting example, I guess I never tried with
Int
. with
String
you get an exception, I guess it might be the compiler unwrapping
Int
to
integer
(compared to
Integer
), where
null == 0
also in plain java. your second example needs a bit of configuration of the kotlin module,
Copy code
jacksonObjectMapper().registerModule(KotlinModule(nullIsSameAsDefault = true))
(moved we don’t spam uninterested people)
👍 1
actually no, tried out and even with kotlin module configured it
Int
becomes
0
🤔
e
Also seems like
value class
is not possible to use with jackson? 🤔
This fails with something about object, creator.. changed branch and nuked the sample before copying the exception..
t
value classes work, just used my first one with jackson last week. but as the channel hints, I am within spring, there might me some extra configuration that is automatically added tbf, when I want to configure object mapper manually I do
ObjectMapper().findAndRegisterModules()
, no idea why jetbrains and spring goes “manual”, as jackson already provides an automatic way for scan
e
Ah, okay.. so just missing some config 👍