Skip to content

refactor!: JSON-RPC SendMessageRequest method handling #627

@muscariello

Description

@muscariello

I think we should revisit this code and match on the JSON RPC method first then perform the correct decoding as there are body types like "SendMessageRequest" which are reused for different methods.

For example:

def _process_request(self, request: JSONRPC20Request):
	match request.method:
		case "SendMessage":
			input: SendMessageRequest = ParseDict(request.params, SendMessageRequest())
			result = await self.handler.on_send_message(input)
		case "CancelTask":
			input: CancelTaskRequest = ParseDict(request.params, CancelTaskRequest())
			...
...

Originally posted by @Tehsmash in #572

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions