Skip to content

feat(deltachat-rpc-server): add --openrpc option #4587

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

Merged
merged 1 commit into from
Aug 1, 2023

Conversation

link2xt
Copy link
Collaborator

@link2xt link2xt commented Aug 1, 2023

This is not exactly the implementation of #4412, but is even easier to use, the server does not even need to be started. rpc.discover method may be automatically added by yerpc in a later version as well for e.g. remote usage over a socket or something like this, but this is not currently needed.

openrpc.json is no longer generated by tests, use deltachat-rpc-server --openrpc >openrpc.json instead.

@link2xt link2xt force-pushed the link2xt/openrpc-command-line-option branch 2 times, most recently from 24da539 to 49cc795 Compare August 1, 2023 15:26
@link2xt link2xt requested review from Simon-Laux and adbenitez August 1, 2023 15:27
@link2xt
Copy link
Collaborator Author

link2xt commented Aug 1, 2023

My idea with this rpc.discover and --openrpc option is to read the OpenRPC specification by the Python code and generate Rpc class methods dynamically. This way we can get autocompletion and help() for RPC methods in REPL without generating Python source code and having any autogenerated files at all.

cc @hpk42 @flub Maybe you have an opinion on how well this would work with Python. I have tried a bit how defining attributes dynamically works with python-mode in Emacs and it seems autocompletion does not care about attributes defined in the REPL with setattr even though they are visible in dir() of the object. But in Jupyter Notebook this works:
1
So with a proper editor support this is possible, but I wonder what setup can we recommend for Emacs, VIM and Visual Studio Code?

@link2xt link2xt force-pushed the link2xt/openrpc-command-line-option branch from 49cc795 to 6cbe3eb Compare August 1, 2023 15:34
@link2xt link2xt requested review from hpk42 and flub August 1, 2023 15:34
@link2xt link2xt merged commit 13e766b into master Aug 1, 2023
@link2xt link2xt deleted the link2xt/openrpc-command-line-option branch August 1, 2023 18:27
@link2xt link2xt added the jsonrpc label Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants