Skip to content

Swagger method with empty body for grpc get request #42407

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

Closed
1 task done
careless6666 opened this issue Jun 24, 2022 · 2 comments
Closed
1 task done

Swagger method with empty body for grpc get request #42407

careless6666 opened this issue Jun 24, 2022 · 2 comments
Assignees
Labels
area-grpc Includes: GRPC wire-up, templates Docs This issue tracks updating documentation investigate
Milestone

Comments

@careless6666
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

We use gRPC HTTP API from project (https://github.com/aspnet/AspLabs/tree/main/src/GrpcHttpApi)

when generating a grpc getway, there is a problem that the contract that maps to the get request describes the parameters that should go into the query string, but instead a swagger is generated without any parameters at all

example

`
syntax = "proto3";

import "google/api/annotations.proto";

package greet;

service Greeter {
rpc SayHello (HelloRequest) returns (HelloReply) {
option (google.api.http) = {
get: "/v1/greeter"
};
}
}

message HelloRequest {
string name = 1 ;
string test = 2;
}

`
it is generate curl in swagger with empty form for get method like this

curl -X GET "http://localhost:5180/v1/greeter" -H "accept: application/json"

expected

curl -X GET "http://localhost:5180/v1/greete?name=test1&test=test2" -H "accept: application/json"

My code example
https://github.com/careless6666/grpc-swagger-issue/tree/feature/empty-params

Expected Behavior

Expected swagger with form for input query string parameters and same curl

curl -X GET "http://localhost:5180/v1/greete?name=test1&test=test2" -H "accept: application/json"

Steps To Reproduce

My code example with full reproduce problem

https://github.com/careless6666/grpc-swagger-issue/tree/feature/empty-params

Exceptions (if any)

No response

.NET Version

dotnet 6.0

Anything else?

No response

@TanayParikh TanayParikh added the area-grpc Includes: GRPC wire-up, templates label Jun 24, 2022
@rafikiassumani-msft rafikiassumani-msft added Docs This issue tracks updating documentation investigate labels Jul 26, 2022
@rafikiassumani-msft rafikiassumani-msft added this to the 7.0.0 milestone Jul 26, 2022
@nicks219
Copy link

Hello. I suggested a fix idea for the grpc swagger query parameters resolver (for all methods), link above. Thx.

@careless6666
Copy link
Contributor Author

I think it looks good, but my opinion does not matter much, what matters is what says @JamesNK , who wrote almost all of this part related to the grps

@ghost ghost locked as resolved and limited conversation to collaborators Oct 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-grpc Includes: GRPC wire-up, templates Docs This issue tracks updating documentation investigate
Projects
None yet
Development

No branches or pull requests

5 participants