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

Use custom serializer for ScientificUnits instead of generated #597

Open
vpodlesnyak opened this issue Nov 28, 2022 · 0 comments
Open

Use custom serializer for ScientificUnits instead of generated #597

vpodlesnyak opened this issue Nov 28, 2022 · 0 comments
Labels
1.x.x expected somewhere in a future release enhancement New feature or request proposal

Comments

@vpodlesnyak
Copy link
Contributor

Is your feature request related to a problem? Please describe.
The generated serializer uses a full class name for serialization and in case of kotlin-firebase-sdk a class

package dev.gitlive.firebase

@Serializable
sealed class SealedClass {
    @Serializable
    object AnObject: SealedClass()
}

is serialized as

[dev.gitlive.firebase.SealedClass.AnObject, {}]

which

  • is redundant
  • prevents the sealed class ever to be moved to a different package
  • creates complications when stored with Firestore in some cases - nested arrays are forbidden

Describe the solution you'd like
A suggested solution would be to create a custom serializer or a set of serializers which would encode Scientific units as a plain string

@vpodlesnyak vpodlesnyak added enhancement New feature or request proposal 0.6.0 labels Nov 28, 2022
@Daeda88 Daeda88 added 1.x.x expected somewhere in a future release and removed 0.6.0 labels Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.x.x expected somewhere in a future release enhancement New feature or request proposal
Projects
None yet
Development

No branches or pull requests

2 participants