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
@Serdeable.Deserializable(as = ...) Should be able to deserialize correctly using the provided data type
Actual Behaviour
When using @Serdeable.Deserializable(as = com.google.common.collect.ImmutableList), Micronaut Serialization throws an exception:
Error decoding HTTP response body: No bean introspection available for type [class com.google.common.collect.ImmutableList]. Ensure the class is annotated with io.micronaut.core.annotation.Introspected.
Note
I was able to identify that this bug was introduced in Micronaut Serialization 2.12.1
Steps To Reproduce
I attached an example app, but if you want to do it manually:
Create a new Micronaut project with HTTP client, Guava and WireMock (or a similar one)
Create a DTO and add collection field to it. Annotate it with @Serdeable.Deserializable(as = ...), for example @Serdeable.Deserializable(as = com.google.common.collect.ImmutableList)
Create an HTTP client with a method that has the previously created DTO as return type
Create a test, use WireMock (or a similar one) to stub the HTTP response and write a simple assert (e.g., assert that the collection is empty)
When you run it, you'll get the exception.
Now, in the pom.xml file, change the micronaut.serialization.version to 2.12.0.
Clean-compile and re-run the test, and this time it will pass.
Let me know if more information is required. Thanks!
Expected Behavior
@Serdeable.Deserializable(as = ...)
Should be able to deserialize correctly using the provided data typeActual Behaviour
When using
@Serdeable.Deserializable(as = com.google.common.collect.ImmutableList)
, Micronaut Serialization throws an exception:Error decoding HTTP response body: No bean introspection available for type [class com.google.common.collect.ImmutableList]. Ensure the class is annotated with io.micronaut.core.annotation.Introspected.
Note
I was able to identify that this bug was introduced in Micronaut Serialization 2.12.1
Steps To Reproduce
I attached an example app, but if you want to do it manually:
@Serdeable.Deserializable(as = ...)
, for example@Serdeable.Deserializable(as = com.google.common.collect.ImmutableList)
pom.xml
file, change themicronaut.serialization.version
to2.12.0
.Let me know if more information is required. Thanks!
Environment Information
OS: Linux / Windows / MacOS
JDK Version: 21
Example Application
https://github.com/Nahuel92/poc-projects/tree/master/micronaut/micronaut-serialization-bug
Version
4.7.5
The text was updated successfully, but these errors were encountered: