Skip to content

✨ New serializers for Zero #793

@LVMVRQUXL

Description

@LVMVRQUXL

πŸ“ Description

Originally commented here.

For simplifying the Application Programming Interface (API) of the types-kotlinx-serialization Gradle subproject, we want to introduce the different serializers for the Zero type as extension functions on the Zero.Companion type.

fun Zero.Companion.byteSerializer(): KSerializer<Zero> = TODO()
fun Zero.Companion.shortSerializer(): KSerializer<Zero> = TODO()
fun Zero.Companion.intSerializer(): KSerializer<Zero> = TODO()
fun Zero.Companion.longSerializer(): KSerializer<Zero> = TODO()
fun Zero.Companion.floatSerializer(): KSerializer<Zero> = TODO()
fun Zero.Companion.doubleSerializer(): KSerializer<Zero> = TODO()
fun Zero.Companion.stringSerializer(): KSerializer<Zero> = TODO()

The Kotlin Serialization library being dedicated to Kotlin, these functions must be marked with the JvmSynthetic annotation for hiding it from Java.

Finally, we want to deprecate the ZeroAsByteSerializer experimental type with an error level for using the Zero.Companion.byteSerializer() function instead.

πŸ”— Dependencies

This issue is blocked by the following items:

βœ… Checklist

See the Issue implementation section in the contributing guidelines before addressing the following checklist.

  • ✨ Add the Zero.Companion.byteSerializer() extension function with tests, documentation and samples.
  • πŸ—‘οΈ Deprecate the ZeroAsByteSerializer type.
  • ✨ Add the Zero.Companion.shortSerializer() extension function with tests, documentation and samples.
  • ✨ Add the Zero.Companion.intSerializer() extension function with tests, documentation and samples.
  • ✨ Add the Zero.Companion.longSerializer() extension function with tests, documentation and samples.
  • ✨ Add the Zero.Companion.floatSerializer() extension function with tests, documentation and samples.
  • ✨ Add the Zero.Companion.doubleSerializer() extension function with tests, documentation and samples.
  • ✨ Add the Zero.Companion.stringSerializer() extension function with tests, documentation and samples.
  • βœ… Update tests of these new serializers.
  • ♻️ Refactor string serializers.
  • πŸ“ Update the unreleased changelog for this issue.
  • πŸ“ After closing this issue, update the status of tracking issues depending on this one.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions