Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serialization of RealmAny with collections #1494

Merged
merged 15 commits into from
Sep 5, 2023

Conversation

rorbech
Copy link
Contributor

@rorbech rorbech commented Aug 30, 2023

This adds a suggested workaround for support of serialization of RealmAnys with nested collections.

It seems that statically annotated serializers cannot be mutually recursive, so RealmListKSerializer, etc. cannot be used to serialize RealmList<RealmAny?> from inside the RealmAny serializer. This PR is a suggested workaround for this until we get to the root of the issue, but requires users to manual add the contextual serializers as shown in the tests in https://github.com/realm/realm-kotlin/compare/cr/collections-in-mixed...cr/collection-in-mixed-serialization?expand=1#diff-64803515612f60c2bc368eac00a24dab29eaee3b05952461ffb092790cc55c76R92.

cmelchior and others added 9 commits September 1, 2023 11:18
# Conflicts:
#	CHANGELOG.md
#	packages/cinterop/src/commonMain/kotlin/io/realm/kotlin/internal/interop/ErrorCode.kt
#	packages/cinterop/src/jvm/kotlin/io/realm/kotlin/internal/interop/ErrorCode.kt
#	packages/cinterop/src/nativeDarwin/kotlin/io/realm/kotlin/internal/interop/ErrorCode.kt
#	packages/external/core
@rorbech rorbech merged commit 1af3d75 into cr/collections-in-mixed Sep 5, 2023
1 check passed
@rorbech rorbech deleted the cr/collection-in-mixed-serialization branch September 5, 2023 08:25
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants