Swagger method with empty body for grpc get request #42407
Labels
area-grpc
Includes: GRPC wire-up, templates
Docs
This issue tracks updating documentation
investigate
Milestone
Is there an existing issue for this?
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
The text was updated successfully, but these errors were encountered: