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
What is your use-case and why do you need this feature?
I'm trying to migrate my Python AI agent project into Kotlin.
With Python
When validating the json output from the LLM, I use Pydantic to set the requirements on the fields of a data class.
It gives me clear error message with a unified ValidationError, allowing me to extract error information and fix it with LLM.
With Kotlin
kotlinx.serialization gives clear error message with path when there is missing fields. When it comes with the validation of the value, I use a init block in the data class to validate the input value.
When the validation fails, the exception is thrown with no path info, and it's not wrapped with SerializationException.
Describe the solution you'd like
When the constructor throws an IllegalArgumentException while deserialization, the exception should be wrapped and add path info on it.
When the exception happend, the raw input should be kept and accessible fully. (Currently the input will be shorten if larger than 200 chars)