We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
define a service
// 测试信息 rpc GetTest(google.protobuf.Empty) returns(TestReply){ option (google.api.http) = { get: "/v1/test" };
proto type
message TestReply{ int64 count = 1; message TestPayload{ int32 age = 1; int32 height =2; } TestPayload payload = 2; }
the logic at service
func (a TestService) GetTest(context.Context, *emptypb.Empty) (*v1.TestReply, error) { return &v1.TestReply{ Count: 11, Payload: &v1.TestReply_TestPayload{ Age: 22, Height: 111, }, }, nil }
and call from url /v1/test get response
/v1/test
{ "count": "11", "payload": { "age": 22, "height": 111 } }{ "count": 11, "payload": { "age": 22, "height": 111 } }
the count feild was not right,should be int64 rather than string,then I change the count type to int32
message TestReply{ int32 count = 1; message TestPayload{ int32 age = 1; int32 height =2; } TestPayload payload = 2; }
response is return as expect
{ "count": 11, "payload": { "age": 22, "height": 111 } }
The text was updated successfully, but these errors were encountered:
grpc-ecosystem/grpc-gateway#438
Sorry, something went wrong.
No branches or pull requests
define a service
proto type
the logic at service
and call from url
/v1/test
get responsethe count feild was not right,should be int64 rather than string,then I change the count type to int32
response is return as expect
The text was updated successfully, but these errors were encountered: