ZioJsonPayloadConverter

zio.temporal.json.ZioJsonPayloadConverter
See theZioJsonPayloadConverter companion object
final class ZioJsonPayloadConverter(registry: CodecRegistry, encodingName: String) extends PayloadConverter

A Temporal PayloadConverter backed by zio-json and a CodecRegistry.

Encoding: looks up a JsonEncoder by the value's runtime class. Decoding: looks up a JsonDecoder by the requested generic Type (not just raw class), so List[Foo] and List[Bar] dispatch distinctly.

The encodingName argument controls the Temporal payload-encoding metadata string this converter claims. Default is "json/zio". A second instance in the chain with "json/plain" is used purely for decode — it lets recorded workflow histories that were originally written with Temporal's Jackson-based DefaultDataConverter (and therefore carry encoding=json/plain) replay through zio-json, since json/plain is just vanilla JSON and the registry's decoders handle it identically.

Throws DataConverterException with a specific message if a codec is missing — this should not happen for types exercised via zio-temporal's typed stubs/workers (the compile-time gate ensures registration) but can occur for untyped stubs or manual payload manipulation.

Attributes

Companion
object
Graph
Supertypes
trait PayloadConverter
class Object
trait Matchable
class Any

Members list

Value members

Constructors

def this(registry: CodecRegistry)

Convenience secondary constructor: default encoding "json/zio".

Convenience secondary constructor: default encoding "json/zio".

Attributes

Concrete methods

override def fromData[T](content: Payload, valueClass: Class[T], valueType: Type): T

Attributes

Definition Classes
PayloadConverter
override def getEncodingType: String

Attributes

Definition Classes
PayloadConverter
override def toData(value: Any): Optional[Payload]

Attributes

Definition Classes
PayloadConverter

Inherited methods

@Experimental @Nonnull
def withContext(context: SerializationContext): PayloadConverter

Attributes

Inherited from:
PayloadConverter