JSONRPCMessage Serializer
class JSONRPCMessageSerializer<P>(paramsSerializer: KSerializer<P>) : KSerializer<JSONRPCMessage<P>> (source)
Content-based polymorphic serializer for JSONRPCMessage.
Discriminates between JSONRPCRequest and JSONRPCNotification based on the presence of the "id" field in the JSON object:
"id"present → JSONRPCRequest"id"absent → JSONRPCNotification
The params field is serialized as raw JsonElement by default. For typed params, supply a concrete paramsSerializer.
Parameters
params Serializer
Serializer for the params value.
Type Parameters
P
The type of the params field.