Translate RESTFul to capnp

86 views
Skip to first unread message

mostafa....@gmail.com

unread,
Aug 22, 2020, 8:21:03 AM8/22/20
to Cap'n Proto
I am wondering if there is any plugin for capnp similar to gRPC-Gateway which translates a RESTful HTTP API into gRPC. This is a very useful tools specially for debugging purpose.
 

Kenton Varda

unread,
Aug 24, 2020, 11:30:23 AM8/24/20
to mostafa....@gmail.com, Cap'n Proto
Hi Mostafa,

Nope, we don't have that yet. We have JsonCodec to translate JSON to Cap'n Proto, but no one has put it together into an HTTP service just yet.

It's more complicated for Cap'n Proto compared to gRPC because of capabilities and promise pipelining. There isn't an obvious way to expose those over HTTP. We could make a version that just doesn't support them but that risks encouraging people to design interfaces without using these important tools.

For debugging, another thing I'd like to do someday is have the `capnp` tool itself support a REPL and scripting mode for sending RPCs to remote servers... but, that's a big project.

-Kenton

On Sat, Aug 22, 2020 at 7:21 AM mostafa....@gmail.com <mostafa....@gmail.com> wrote:
I am wondering if there is any plugin for capnp similar to gRPC-Gateway which translates a RESTful HTTP API into gRPC. This is a very useful tools specially for debugging purpose.
 

--
You received this message because you are subscribed to the Google Groups "Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capnproto+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/capnproto/94c6552c-2865-4d16-9bb5-58cba0f4404dn%40googlegroups.com.

Mostafa Sedaghat joo

unread,
Aug 24, 2020, 10:37:25 PM8/24/20
to Kenton Varda, Cap'n Proto
Dear Kenton

I am using capncp for simple RPC calls. One thing missed in the project is a simple example of how to use Capnp as an RPC service. I add an example for Rust version:

I understand the concept and agree with you. Even marshalizing capnp data into json won't help so much. Another parser for Json is something necessary but can't be done inside capnp.

Thanks  
Reply all
Reply to author
Forward
0 new messages