-
Notifications
You must be signed in to change notification settings - Fork 18
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
Json Type no longer works for Kotlin sealed classes in Micronaut 4.0.0 #580
Comments
Going through the code, providing the following bean seems to restore the previous behaviour:
Still not sure if it's wise to rely on classes marked as Internal though. |
There is another workaround, if that's ok with your project. Excluding micronaut serde jackson
and then make sure jackson databind is imported
then |
@graemerocher Do we support this case in Micronaut Serialization? |
Documentation for configuring serde dependency in Micronaut 4: https://micronaut.io/2023/02/27/micronaut-framework-4-0-and-micronaut-jackson-databind-transitive-dependency/ |
Expected Behavior
Fields annotated with DataType.JSON should continue to be serializable and deserializable. The following should work as it used to work in Micronaut 3.x:
Actual Behaviour
Getting a SerDe exception:
I've followed the instructions on adding the dependencies for updating to Micronaut 4.x. I've also tried annotating the Kotlin classes with
@Serdeable
but then I'm hitting a "No Default constructor exists" exception which seems to be a limitation of Micronaut Serialization.Is there a way to opt out from Micronaut Serialization back to plain Jackson?
Thanks
Steps To Reproduce
No response
Environment Information
Example Application
No response
Version
4.0.0
The text was updated successfully, but these errors were encountered: