automorph.protocol.JsonRpcProtocol
See theJsonRpcProtocol companion object
final case class JsonRpcProtocol[Node, Codec <: MessageCodec[Node], Context](messageCodec: Codec, mapError: (String, Int) => Throwable, mapException: Throwable => ErrorType, namedArguments: Boolean, mapOpenApi: OpenApi => OpenApi, mapOpenRpc: OpenRpc => OpenRpc, encodeMessage: (Message[Node]) => Node, decodeMessage: Node => Message[Node], encodeOpenRpc: OpenRpc => Node, encodeOpenApi: OpenApi => Node, encodeStrings: (List[String]) => Node) extends RpcProtocol[Node, Codec, Context]
JSON-RPC protocol plugin.
Provides the following JSON-RPC methods for service discovery:
rpc.discover
- API schema in OpenRPC format
api.discover
- API schema in OpenAPI format
Type parameters
-
Codec
-
message codec plugin type
-
Context
-
RPC message context type
-
Node
-
message node type
Value parameters
-
decodeMessage
-
converts a message format node to JSON-RPC message
-
encodeMessage
-
converts a JSON-RPC message to message format node
-
encodeOpenApi
-
converts an OpenAPI schema to message format node
-
encodeOpenRpc
-
converts an OpenRPC description to message format node
-
encodeStrings
-
converts a list of strings to message format node
-
mapError
-
maps a JSON-RPC error to a corresponding exception
-
mapException
-
maps an exception to a corresponding JSON-RPC error
-
mapOpenApi
-
transforms generated OpenAPI schema
-
mapOpenRpc
-
transforms generated OpenRPC schema
-
messageCodec
-
message codec plugin
-
namedArguments
-
if true, pass arguments by name, if false pass arguments by position
Attributes
-
Constructor
-
Creates a JSON-RPC protocol plugin.
-
See also
-
-
Companion
-
object
-
Graph
-
-
Supertypes
-
trait Serializable
class Object
trait Matchable
class Any
Show all
Members list
Creates a copy of this protocol with specified message contex type.
Creates a copy of this protocol with specified message contex type.
Type parameters
-
NewContext
-
RPC message context type
Attributes
-
Returns
-
JSON-RPC protocol
-
Inherited from:
-
JsonRpcCore (hidden)
Creates a copy of this protocol with specified JSON-RPC error to exception mapping.
Creates a copy of this protocol with specified JSON-RPC error to exception mapping.
Value parameters
-
errorToException
-
maps a JSON-RPC error to a corresponding exception
Attributes
-
Returns
-
JSON-RPC protocol
-
Inherited from:
-
JsonRpcCore (hidden)
Creates a copy of this protocol with specified exception to JSON-RPC error mapping.
Creates a copy of this protocol with specified exception to JSON-RPC error mapping.
Value parameters
-
exceptionToError
-
maps an exception classs to a corresponding JSON-RPC error type
Attributes
-
Returns
-
JSON-RPC protocol
-
Inherited from:
-
JsonRpcCore (hidden)
Creates a copy of this protocol with given OpenAPI description transformation.
Creates a copy of this protocol with given OpenAPI description transformation.
Value parameters
-
mapOpenApi
-
transforms generated OpenAPI schema or removes the service discovery method if the result is None
Attributes
-
Returns
-
JSON-RPC protocol
-
Inherited from:
-
JsonRpcCore (hidden)
Creates a copy of this protocol with given OpenRPC description transformation.
Creates a copy of this protocol with given OpenRPC description transformation.
Value parameters
-
mapOpenRpc
-
transforms generated OpenRPC schema
Attributes
-
Returns
-
JSON-RPC protocol
-
Inherited from:
-
JsonRpcCore (hidden)
Creates a copy of this protocol with specified named arguments setting.
Creates a copy of this protocol with specified named arguments setting.
Value parameters
-
namedArguments
-
if true, pass arguments by name, if false pass arguments by position
Attributes
-
Returns
-
JSON-RPC protocol
-
See also
-
-
Inherited from:
-
JsonRpcCore (hidden)