Skip to content

Argument to change method name in decorator? #115

@akuzia

Description

@akuzia

I wonder is there a convinient way to change method name? I've found some comments in Methods class, tryed to use decorators to change function __name__ values. Is there a possibility to include kwargs to method decorator, lke in jsonrpc add_method?

from jsonrpcserver import method, serve


@method(name='generic.ping')
def ping():
    return "pong"


if __name__ == "__main__":
    serve()

so calls like:

{
	"id":"d3fa8fd5-259e-9e02-6d07-25dbf49e410f",
	"jsonrpc":"2.0",
	"method":"generic.ping"
}

will be possible?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions