Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementing named arguments in the store json-rpc API #533

Closed
staheri14 opened this issue May 5, 2021 · 1 comment
Closed

Implementing named arguments in the store json-rpc API #533

staheri14 opened this issue May 5, 2021 · 1 comment

Comments

@staheri14
Copy link
Contributor

staheri14 commented May 5, 2021

Problem

The parameters passed to the current store json-rpc api is position based. This means optional parameters has to be explicitly set to null while being send to the api. Only parameters towards the end of the arguments list can be left unspecified but not the middle ones. What we are looking for is to be able to use named-argument passing so that optional arguments can be entirely omitted.
This feature must be normally supported by nim-json-rpc lib (As also indicated in the json-rpc specs https://www.jsonrpc.org/specification under sec 4.2), which is not the case yet. Here is the issue re this status-im/nim-json-rpc#90.

Till this feature gets integrated in nim-json-rpc, the workaround would be to define a Nim object data type wrapping all the arguments inside. The inputs to the rpc procs will be replaced by that Nim object. This means rpc call optional arguments which are now the data members of the Nim object can be omitted with no error.

@oskarth
Copy link
Contributor

oskarth commented Jul 14, 2021

Duplicate, upstream

@oskarth oskarth closed this as completed Jul 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants