AnySerializer

object AnySerializer : KSerializer<Any>

Serializes an untyped Any value by converting it to/from a raw JsonElement tree — via Any?.toJsonElement()/JsonElement.toAny() — the mechanism behind every "opaque payload" field in the framework (an event's body, data, EvaluateData's inline literals, etc.), where the field's real shape is only known at runtime, not at schema-authoring time. Reached via the AnySerializable typealias, never used directly.

When the active Encoder/Decoder is JSON-native (JsonEncoder/JsonDecoder — true for dev.catbit.mosaic.core.serialization.MosaicSerializer.json, the format the whole framework actually uses), the tree is embedded structurally. For a non-JSON format, it falls back to embedding the JSON tree as a single encoded string — a degraded but still round-trippable path, never exercised by the framework's own JSON-only wire format in practice.

Properties

Link copied to clipboard
open override val descriptor: SerialDescriptor

Functions

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