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

Add export to grpcurl #71

Open
federicotdn opened this issue Jul 4, 2024 · 1 comment
Open

Add export to grpcurl #71

federicotdn opened this issue Jul 4, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@federicotdn
Copy link
Owner

Verb could also export to https://github.com/fullstorydev/grpcurl. Though the requests definitions in Verb are technically for HTTP/1.1, the syntax could kind of work for unary gRPC requests (not streams).

The only extra piece of data needed would be the location of the .proto file. Here's what it could look like:

* gRPC Example
:properties:
:Verb-Grpc-Proto: path/to/file/example.proto
:end:
template my-grpc-server.org:443
Foobar: Value 1234

** My Service
template /namespace.MyService

*** Get user
get /RetrieveUser

*** Add user
post /AddUser

{
    "name": "fede"
}

Here it is not clear if the user should use get or post or whatever, because technically they are all incorrect. But assuming any option is valid, the last header would be exported to:

grpcurl -H 'Foobar: Value 1234' -import-path /path/to/file -proto example.proto -d '{"name":"fede"}' namespace.MyService.AddUser

If the user tries to actually send the request via Verb, then it would need to error out in a friendly way.

@federicotdn federicotdn added the enhancement New feature or request label Jul 4, 2024
@federicotdn
Copy link
Owner Author

Correction: it should be all POST and not GET.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant