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
Iterable types that do not implement the List or Set interfaces or are array types are serialized as objects rather than collections. It would be helpful to serialize these as arrays.
This causes issues when attempting to serialize other collection types that do not implement the List or Set interfaces, such as java.util.HashMap#values.
The default Jackson implementation appears to serialize Iterable types as collections by default through IterableSerializer (at least I believe it's by default -- it might be a configuration that I'm not seeing).
In order to enable serializing Iterable types as collections, we would need to make a small modification in the JsonViewSerializer#writeList(Object) method:
Iterable
types that do not implement theList
orSet
interfaces or are array types are serialized as objects rather than collections. It would be helpful to serialize these as arrays.This causes issues when attempting to serialize other collection types that do not implement the
List
orSet
interfaces, such asjava.util.HashMap#values
.The default Jackson implementation appears to serialize
Iterable
types as collections by default throughIterableSerializer
(at least I believe it's by default -- it might be a configuration that I'm not seeing).In order to enable serializing
Iterable
types as collections, we would need to make a small modification in theJsonViewSerializer#writeList(Object)
method:Is there any reason not to do this?
The text was updated successfully, but these errors were encountered: