[ 
https://issues.apache.org/jira/browse/JOHNZON-229?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16902947#comment-16902947
 ] 

Steven Walters commented on JOHNZON-229:
----------------------------------------

Hi,
Yes, I was hoping for Stream to be serialized as a JSON array (using 
.iterator(), which I see as the implemented in the associated commit).
support for Stream has no big overhead in comparison to Iterable or Iterator, 
as iterating over anything can be complex if the underlying Iterator is complex 
in it's behavior.
I just see it that Stream just natively supports more complex behavior more 
easily than making transformers or filters on an Iterator...

I expected deserialization to have too many complexities to tackle quickly 
without vesting out with others, so I was surprised to see it included in the 
associated commit...
I'm truthfully not sure how one would expect deserialization into a Stream to 
function, but as a starting point the implementation in the commit seems 
reasonable enough of interpreting as an JSON array (Collection) and invoking 
.stream() on that.


> Mapper should support serializing java.util.stream.Stream
> ---------------------------------------------------------
>
>                 Key: JOHNZON-229
>                 URL: https://issues.apache.org/jira/browse/JOHNZON-229
>             Project: Johnzon
>          Issue Type: Improvement
>          Components: Mapper
>    Affects Versions: 1.1.13
>            Reporter: Steven Walters
>            Assignee: Romain Manni-Bucau
>            Priority: Major
>             Fix For: 1.1.14
>
>
> Currently, Mapper does not support serializing java.util.stream.Stream
> Since Johnzon uses Java 1.8 as the minimum supported version (which is the 
> minimum version that defines Stream).
> This has come up quite a bit in combination with JPA 2.2 which supports 
> Stream as the return of a QueryResult (in addition to List)



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Reply via email to