https://kotlinlang.org logo
Title
u

user

06/30/2022, 3:11 PM
@NotNull not working on nested object properties in a Kotlin class even though @Valid is added I have a spring-boot app in Kotlin. I have a model called MyModel with just two field : a, b NotNull validation works fine on a but it doesn't work on b although I've added @valid on top of b. So when I don't pass b in my api request, it doesn't invalidate the model, although it's invalid (since b is missing). I really don't know why it doesn't work. if I remove ? to enforce not nullness, then Jackson would throw exception when trying to deserializing the model. So I cannot make it...