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

Imported proto definitions? #62

Closed
alexander-alvarez opened this issue Mar 13, 2017 · 1 comment
Closed

Imported proto definitions? #62

alexander-alvarez opened this issue Mar 13, 2017 · 1 comment

Comments

@alexander-alvarez
Copy link

Hey -- I'm trying to import a proto definition, and what I'm trying to do isn't covered by an existing test case, so I couldn't model it off of that.

Basically I want to import the struct definition from google.protobuf

// have tried "google.protobuf", "google.protobuf.struct",  "google.protobuf.struct.proto"
// "google/protobuf/struct" to no avail
import "google.protobuf";

message Response {
    enum StatusCode {
        SUCCESS = 0;
        FAILURE = 1;
        CANCELLED = 2;
    }

    StatusCode status = 1;
    // I've tried permutations of `Struct`, `google.protobuf.Struct` to no avail
    repeated Struct data = 2; 
}

But when I call mix grpc.gen I get Reference to undefined message Struct... I would expect the import
to throw an exception if it was invalid, so I'm having trouble figuring out if my import is wrong or my proto3 type definition is wrong.

similar to this test case, except I want to use WrongAuthorizationHttpMessage inside of the WebsocketServerContainer message, for example.

Any thoughts or guidance?

@alexander-alvarez
Copy link
Author

alexander-alvarez commented Mar 14, 2017

elixir-grpc/grpc#8

and correct syntax is:

import "google/protobuf/struct.proto";

message Response {
    repeated google.protobuf.Struct data = 1; 
}

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