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

Response type not resolved in service methods #497

Closed
subk opened this issue Nov 28, 2016 · 0 comments
Closed

Response type not resolved in service methods #497

subk opened this issue Nov 28, 2016 · 0 comments
Labels

Comments

@subk
Copy link
Contributor

subk commented Nov 28, 2016

Calling resolve() on a service method properly set resolvedRequestType but resolvedResponseType is always null.

.proto :

syntax = "proto3";

package example1;

message MyRequest {
  string foo = 1;
}
message MyResponse {
  string bar = 1;
}
service MyTestService {
  rpc getTest(MyRequest) returns (MyResponse);
}

.js :

protobuf
  .load(proto)
  .then(root => {
    const service = root.lookup('example1.MyTestService');
    for (let name in service.methods) {
      const method = service.methods[name];
      method.resolve();
      console.log(method.resolvedRequestType instanceof protobuf.Type);
      console.log(method.resolvedResponseType instanceof protobuf.Type);
    }
  });

output :

true
false
dcodeIO added a commit that referenced this issue Nov 28, 2016
set resolvedResponseType on resolve(), fixes #497
@dcodeIO dcodeIO added the bug label Nov 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants