Skip to content

Support [De]serialisation of Streams #669

Description

@dansiviter

Is your feature request related to a problem? Please describe.
When using large datasets it's often preferred to use Streams to reduce memory consumption. Currently, using Stream#of, List#of#stream, etc., in v3.0.4 results in:

jakarta.json.bind.JsonbException: Error accessing getter 'isParallel' declared in 'class java.util.stream.AbstractPipeline'
        at org.eclipse.yasson.internal.model.PropertyModel.createReadHandle(PropertyModel.java:513)
        at org.eclipse.yasson.internal.model.PropertyModel.<init>(PropertyModel.java:157)
        at org.eclipse.yasson.internal.ClassParser.lambda$parseProperties$0(ClassParser.java:70)
        ...

Describe the solution you'd like
A stream of objects [de]serialise into/from a JSON array of objects.

Describe alternatives you've considered
N/A

Additional context
Current workaround it to use Stream#asList but that defeats the point of using Streams.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions