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
Just wondering if it would be possible for KotlinValueInstantiator to throw a more specific exception for missing mandatory fields (i.e. mandatory kotlin constructor params)?
Our use case is that we're using kotlin data classes in our Spring Boot REST APIs. We've got some basic exception handling to provide more meaningful API errors when Jackson has an issue with the JSON (e.g. invalid enum values, invalid date formats, etc), but currently there's no easy way to identify missing mandatory values (i.e. mandatory kotlin constructor params), as it just throws a generic JsonMappingException.
I can't see a good fit among the existing exceptions, so it would have to be a new one, maybe MissingKotlinParameterException?
Hi, thanks so much for the kotlin module :)
Just wondering if it would be possible for
KotlinValueInstantiator
to throw a more specific exception for missing mandatory fields (i.e. mandatory kotlin constructor params)?Our use case is that we're using kotlin data classes in our Spring Boot REST APIs. We've got some basic exception handling to provide more meaningful API errors when Jackson has an issue with the JSON (e.g. invalid enum values, invalid date formats, etc), but currently there's no easy way to identify missing mandatory values (i.e. mandatory kotlin constructor params), as it just throws a generic
JsonMappingException
.I can't see a good fit among the existing exceptions, so it would have to be a new one, maybe
MissingKotlinParameterException
?I've created a PR, see #33
The text was updated successfully, but these errors were encountered: