JsonRpcProtocol

automorph.protocol.JsonRpcProtocol
See theJsonRpcProtocol companion object

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
trait Product
trait Equals
trait RpcProtocol[Node, Codec, Context]
class Object
trait Matchable
class Any
Show all

Members list

Type members

Inherited types

type Metadata = Option[Id]

JSON-RPC message metadata.

JSON-RPC message metadata.

Attributes

Inherited from:
JsonRpcCore (hidden)

Value members

Inherited methods

override def apiSchemas: Seq[ApiSchema[Node]]

Attributes

Definition Classes
Inherited from:
JsonRpcCore (hidden)

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)

Attributes

Definition Classes
Inherited from:
JsonRpcCore (hidden)

Attributes

Definition Classes
Inherited from:
JsonRpcCore (hidden)
def mapError(errorToException: (String, Int) => Throwable): JsonRpcProtocol[Node, Codec, Context]

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)
def mapOpenApi(mapOpenApi: OpenApi => OpenApi): JsonRpcProtocol[Node, Codec, Context]

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)
def mapOpenRpc(mapOpenRpc: OpenRpc => OpenRpc): JsonRpcProtocol[Node, Codec, Context]

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)
def namedArguments(namedArguments: Boolean): JsonRpcProtocol[Node, Codec, Context]

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)

Attributes

Definition Classes
Inherited from:
JsonRpcCore (hidden)

Attributes

Definition Classes
Inherited from:
JsonRpcCore (hidden)

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product

Inherited fields

val name: String

Attributes

Inherited from:
JsonRpcCore (hidden)