AggregateIdJsonSerializer

object AggregateIdJsonSerializer : StdSerializer<AggregateId>

Jackson JSON serializer for AggregateId objects.

This serializer converts an AggregateId instance into a JSON object containing the context name, aggregate name, aggregate ID, and tenant ID using predefined field names from MessageRecords.

Example usage:

val aggregateId = MaterializedNamedAggregate("context", "aggregate").aggregateId("id", "tenant")
val json = ObjectMapper().writeValueAsString(aggregateId)
// Produces: {"contextName":"context","aggregateName":"aggregate","aggregateId":"id","tenantId":"tenant"}

Functions

Link copied to clipboard
open override fun serialize(value: AggregateId, generator: JsonGenerator, provider: SerializationContext)

Serializes the given AggregateId to JSON.