JsonRpcContextConvention

sealed interface JsonRpcContextConvention

Convention for carrying @KsContext wire-context entries over JSON-RPC.

JSON-RPC itself defines only jsonrpc, method, params, id (request) and jsonrpc, result/error, id (response). This sealed interface lets the application choose where context key-value pairs live on the wire.

The default is RootSiblings, which flat-merges context keys as root siblings in the JSON-RPC request/response object.

See also

for the analogous cancellation convention

Inheritors

Types

Link copied to clipboard
object Companion
Link copied to clipboard
data class InParams(val paramsKey: String) : JsonRpcContextConvention

Context map is nested inside the params object under the given key.

Link copied to clipboard

Disabled: no context entries are sent or read on the wire.

Link copied to clipboard
data class RootField(val envelopeKey: String) : JsonRpcContextConvention

Context map is nested under a single root-level field in the JSON-RPC object.

Link copied to clipboard

Context keys are flat-merged as root-level siblings of jsonrpc, method, params, and id in the JSON-RPC request/response objects.

Link copied to clipboard

Delegate context propagation to the underlying HTTP transport headers.