fastapi-jsonrpc
fastapi-jsonrpc copied to clipboard
Support by-position parameters
According to JSON-RPC 2.0 Specification , the params
field of request object may be either by-position (Array) or by-name (Object).
However the current implementation of fastapi-jsonrpc forces to use by-name parameter:
https://github.com/smagafurov/fastapi-jsonrpc/blob/1329be64ea635a844cdb529eaf31a1ac3055ae58/fastapi_jsonrpc/init.py#L369
This causes this awesome library is not usable in some circumstances. Can we support by-position parameters in the future version?
Sure
It was too hard to implement it in quick way. Need more refactoring
@hongqn can you tell what is the "some circumstances" in your cases?
@hongqn can you tell what is the "some circumstances" in your cases?
Thanks for your response!
The situation I encountered is that in the EIP-4337 specification of Ethereum, the parameter of method eth_sendUserOperation
is an array (with two items of different types though), not an object. I haven’t delved deeper into this yet, but it’s possible that there are other methods in Ethereum’s jsonrpc specification that also use arrays instead of objects to pass parameters.
Do you have workaround for that case or you don't use fastapi-jsonrpc for this integration yet?
I finally adopted a Typescript based solution 😅