explodinglabs / jsonrpcclient

Generate JSON-RPC requests and parse responses in Python

Home Page:https://www.jsonrpcclient.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature: JSON-RPC Request validation/parsing

taylorjdawson opened this issue · comments

This library has a method that parses JSON-RPC responses. It would be nice to add the ability to parse/validate JSON-RPC requests.

commented

You can do this with jsonrpcserver.

from jsonrpcserver.dispatcher import deserialize, schema, validate

request = '{"jsonrpc": "2.0", "method": "ping", "id": 1}'
validate(deserialize(request), schema)

Raises jsonschema.ValidationError if invalid.

Great thanks!