JsonHandler<RequestType, ResponseType> typedef

JsonHandler<RequestType, ResponseType> = FutureOr<ResponseType> Function(RequestType request)

The shape of a handler that supports a custom RequestType and ResponseType.

The RequestType must be either a type compatible with a JSON literal or have a fromJson constructor with a single, positional parameter that is compatible with a JSON literal.

The ResponseType must be either a type compatible with a JSON literal or have a toJson() function with a returns type compatible with a JSON literal.

Implementation

typedef JsonHandler<RequestType, ResponseType> = FutureOr<ResponseType>
    Function(RequestType request);