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

field in query path not found #629

Closed
gigo1980 opened this issue Apr 28, 2018 · 1 comment
Closed

field in query path not found #629

gigo1980 opened this issue Apr 28, 2018 · 1 comment

Comments

@gigo1980
Copy link

hi, i try to implement the following

syntax = "proto3";
option java_package = "com.polisource.service.stream.grpc";
//option java_multiple_files = true;
//option java_outer_classname = "StreamProto";

package streamservice;
import "google/api/annotations.proto";

message StreamItem {
    string identifier = 1;
    string headline = 2;

    Autor author = 3;
    StreamType type = 4;

    enum StreamType {
        FACEBOOK = 0;
        TWITTER = 1;
        EMAIL = 2;
    }
}

message GetStreamItemRequest{
    string id = 1;
}

message Autor {
    string identifier = 1;
    string author = 2;
}

service StreamService {
    rpc getItem (String) returns (StreamItem){
        option (google.api.http) = {
            get: "/v1/streams/{id}"
        };
    }
}

Any idea why it is missing the field?
it try to run

protoc -I/usr/local/include -I. \
  -I$GOPATH/src \
  -I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \
  --grpc-gateway_out=logtostderr=true:. \
  --proto_path=../service-stream/src/main/proto \
  ../service-stream/src/main/proto/Stream.proto

The reponse is: --grpc-gateway_out: no field "id" found in String

@gigo1980
Copy link
Author

Ok it was my fault,

rpc method signature has to be rpc getItem (GetStreamItemRequest) returns (StreamItem)

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

No branches or pull requests

1 participant