-
-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle unexpected discriminator values #1022
Comments
@karayusuf Hi, Joe! If I understand correctly your JSON input cannot be fully modeled by case classes or evolves faster than your model and the idea of your solution is to avoid throwing of an error for events that are not modeled yet. Based on your code samples I wrote the possible solution here. Please check if my solution works for your case. |
Hi @plokhotnyuk . The code sample you provided looks fantastic. Will play around with it today. Thanks so much! |
Is there a way to decode unexpected discriminator types? Right now, an exception is raised when an unknown discriminator value is provided. I'd like to be able to deserialize the unknown type into an object rather than handling the error.
Example config
Example usage
When an unexpected value is returned, return the configured unknown event class.
The text was updated successfully, but these errors were encountered: