CleoMenezesJr / escambo

Escambo is an HTTP-based APIs test application for GNOME
https://flathub.org/apps/io.github.cleomenezesjr.Escambo
GNU General Public License v3.0
142 stars 10 forks source link

Feature: gRPC support #56

Open Kernald opened 1 year ago

Kernald commented 1 year ago

gRPC is a binary RPC protocol that's often use for very similar use-cases as HTTP APIs. It's different enough that it would take some consideration to support it, but at the same time it could make Escambo a one-stop shop for API testing. Is it something you'd consider?

CleoMenezesJr commented 1 year ago

Hello and thank you for opening this issue! It makes me happy to see that there are people interested in this project.

To be honest, I didn't know this protocol, however, the idea of ​​this application is to be a complete application for API creation and testing. At the moment it doesn't have all the features I would like, but I'm glad I've gotten some contributions and some coffees, and it's given me a little more time and motivation to plan their implementation.

Let's see in the not so distant future. Right now, I'm reading about this protocol.

Kernald commented 1 year ago

Sounds good! I don't have any Python knowledge (and, to be honest, not much time to spend on tooling), but I'd be more than happy to help if you have any questions about the protocol!

jihedmastouri commented 1 year ago

I've been learning gRPC for the past month. I am curious on how to implement that within this application?

Just a thought, would you suggest generating the client code for python and then pointing the application to the directory?

PabloEmidio commented 1 year ago

As someone who works with RPC on a daily basis, I am happy to make myself available to help with its implementation.

CleoMenezesJr commented 1 year ago

Let's keep discussing this, but of course, calmly. A bit more solid knowledge is needed for me, so that I can at least review the contributions and of course, design will be needed to implement this. It must follow the GNOME HIG and always be accessible to users. But to be honest, I'm pretty excited to have such a complete app for APIs.

Kernald commented 1 year ago

Just a thought, would you suggest generating the client code for python and then pointing the application to the directory?

There are different approaches here:

  1. Ask the user to provide the proto files and compile them at runtime transparently. This isn't ideal, because we need to handle that whole compilation step, which is a fairly complex process and might fail for a bunch of reasons (mainly invalid syntax/missing dependency, I guess). I'm again not familiar with Python (nor its Protobuf libraries), but I assume this is what MessageFactory is designed to help with.
  2. Allow the user to send whatever message they see fit. This loses a lot of the benefits gRPC usually brings (type safety), but this works.
  3. Use gRPC's reflection protocol. This is by far the nicest approach as far as user experience is concerned. No need to provide any type definition, they're fetched from the server automatically.

This is what I've seen being done in other tools. There might be more ways to do this!