Replies: 1 comment 3 replies
-
Currently planning for the following usage for writing methods: from jsonrpcserver import method
from jsonrpcserver.dispatcher import Context
from jsonrpcserver.response import InvalidParamsResponse, Response, SuccessResponse
@method
def fruits(context: Context, color: str) -> Response:
if color not in ["red", "orange", "yellow"]:
return InvalidParamsResponse("No fruits of that colour", id=context.request.id)
return SuccessResponse("blue", id=context.request.id) This give the method writer complete control over the response going back to the client. Though I'm not sure about the "id" part, it's annoying to have to specify that every time. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Version 5 is in the
master
branch.Development of version 4 has moved to the
4.x
branch.Beta Was this translation helpful? Give feedback.
All reactions