createIOSerializer

inline fun <I, O> StringFormat.createIOSerializer(): IOSerializer<I, O>(source)

Deprecated

Method has been reloacted. Please use com.varabyte.kobweb.serialization.createIOSerializer instead.

A convenience utility method for creating an IOSerializer for projects using Kotlinx Serialization.

In order to use this, both your worker strategy's input and output types must be classes annotated with @Serializable.

You can use it as in the following code example:

@Serializable
class InputParams(...)

@Serializable
class OutputParams(...)

class ExampleWorkerStrategy: WorkerStrategy<InputParams, OutputParams>() {
override val ioSerializer = Json.createIOSerializer<InputParams, OutputParams>()
}