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

Json support and automatic documentation generation #442

Open
pmantica11 opened this issue Mar 8, 2024 · 2 comments
Open

Json support and automatic documentation generation #442

pmantica11 opened this issue Mar 8, 2024 · 2 comments

Comments

@pmantica11
Copy link

Thank you for this amazing project!

I have two questions:

  1. Does it support jsonrpc?
  2. Does it support automatic SDK generation for the API?
@tikue
Copy link
Collaborator

tikue commented Mar 10, 2024

Hi, thanks!

  1. Reading the spec, it sounds like jsonrpc is a transport-agnostic, stateless RPC protocol. tarpc is also transport-agnostic, so I kind of imagine that a jsonrpc library would be filling a similar niche to tarpc. But if there is a specific crate you are interested in using, share the link and I'll take a look!
  2. If you run cargo doc on your crate, it should generate documentation for the generated types. Is that what you're looking for? Let me know if something appears to be missing. The readme mentions this, but feel free to send a PR if it's not clear enough.

@dan-da
Copy link

dan-da commented Mar 12, 2024

I'm also interested in a tarpc jsonrpc transport.

As I understand it, jsonrpc is transport-agnostic in the sense that it can be used over eg unix sockets, tcp, udp, http, etc. But not in the sense that one can change the serialization format (json) or method invocation and response envelopes.

Clearly json is compatible with tarpc. The question in my mind is if/how the request/response mechanism could be integrated. So a json-rpc method-call would be routed to a tarpc server trait method, and also if a method returns an error then it should be converted into a jsonrpc error.

I'm hopeful that this kind of translation could occur in a hypothetical tarpc-jsonrpc-transport crate, but I am not familiar enough with tarpc's transport plugin layer to understand how methods are invoked exactly.

@tikue does the above seem achievable to you?

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

3 participants