Hamza GATTAL
05/03/2021, 5:02 PMEmil Kantis
05/03/2021, 5:05 PM@get:NotNull
etc. Although I'm not sure why you would need @NotNull
🙂Emil Kantis
05/03/2021, 5:06 PMinit { require(someStringProperty.isNotEmptyOrBlank()) }
, but that doesn't follow Spring conventions I supposeHamza GATTAL
05/03/2021, 5:07 PMBen
05/03/2021, 7:12 PMthanksforallthefish
05/04/2021, 5:35 AM@NotNull
than having the field not-nullable, it makes for easier and better error message given the stack I use (spring boot, web and validation). @NotNull
generates a validation exception which I can treat as all other validations exceptions, which not-nullable field is a kotlin binding error, which needs special treatment. eg
class SomeApiRepresentation(@get:NotNull aNotNullableField: String?)
the price of course is !!
, but I am not a purist, and in this case !!
is fine with meThomas
05/04/2021, 8:05 AM