Skip to content

[Proposal] Correctly encode/decode multi level type hierarchy with multiple labels.#1728

Open
eneim wants to merge 1 commit intosquare:masterfrom
eneim:eneim/polymorphic-multi-labels
Open

[Proposal] Correctly encode/decode multi level type hierarchy with multiple labels.#1728
eneim wants to merge 1 commit intosquare:masterfrom
eneim:eneim/polymorphic-multi-labels

Conversation

@eneim
Copy link

@eneim eneim commented Aug 24, 2023

This PR is a work in progress. However, I would like to share the proposal first, and complete it (or postpone it) depending on the feedback.

This PR is a proposal to fix the two issues above (there are more relevant issues, so it has a high demand). The work mainly benefits the toJson part because fromJson works correctly.

The idea is to fetch through the type hierarchy to find the non-PolymorphicJsonAdapter instance and record the label information throughout the search. Lastly, it writes the recorded labels of the ancestor types before using the actual JsonAdapter to complete writing the JSON.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant