Replies: 1 comment
-
I moved this discussion to Micronaut Core, where I found other Serialization discussions too: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there!
I'm using Java records for my DTOs, which happen to have fields of type List/Map, and I'm trying to enforce immutability. My current DTO looks like:
But it throws:
io.micronaut.core.beans.exceptions.IntrospectionException: No bean introspection available for type [class com.google.common.collect.ImmutableList]. Ensure the class is annotated with io.micronaut.core.annotation.Introspected
.The workaround that I could use is using compact constructors to make the collection immutable, like this:
But I wonder if there is a better approach to achieve immutability, ideally an annotation or an annotation-parameter that doesn't rely on third-party dependencies. I checked the documentation on Micronaut Serialization, and I haven't seen any annotation or configuration to enable this feature.
Any suggestion is appreciated.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions