UriSerializer

object UriSerializer : KSerializer<Uri> (source)

Custom KSerializer for Android's Uri type.

Uri is an Android platform type and cannot be annotated with @Serializable directly. Registering it in a SerializersModule globally would require a custom module passed to every Json instance, which adds hidden coupling. This serializer is also used sparingly across the codebase, so the overhead of a global registration isn't justified. Instead, we keep it explicit so that each usage site opts in intentionally and the serialization behavior remains visible.

Usage:

Properties

Link copied to clipboard
open override val descriptor: SerialDescriptor

Functions

Link copied to clipboard
open override fun deserialize(decoder: Decoder): Uri
Link copied to clipboard
open override fun serialize(encoder: Encoder, value: Uri)