eclipse-ee4j / eclipse-ee4j/jersey

JsonBindingProvider.writeTo() Failed to Process Polymorphic Object

Open
#5,125 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
730
Forks
382
PR merge metrics
No merged PRs in 30d

Description

this PR https://github.com/eclipse-ee4j/jersey/pull/5047 breaks the polymorphic behaviour.
I found a problem when the object is polymorphism, the JSON object won't be written into the `entityStream`.

When the object is polymorphism it will have a parent class type as `genericType` value which causes the `entityStream` is not written correctly which makes the `entityStream` value = {}.

`jsonb.toJson(object, type, writer)` will only write the object into `entityStream` if the `object` has equal class type with `type` parameter

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.