Extensions #27

Open
Jud opened this Issue Mar 29, 2013 · 0 comments

Comments

Projects
None yet
1 participant

Jud commented Mar 29, 2013

Extensions don't seem to work. For example, here is my base.proto:

message Request {
  enum RequestType {
    // Let us know you are a player
    AUTH  = 1;

    // These apply to `channels`
    JOIN  = 2;
    LEAVE = 3;

    // This is a passthrough type
    // Pocket will pass this to the server listeners
    // for decoding
    MESSAGE = 4;
  }

  message Auth {
    optional string key = 1;
    optional string verifier = 2;
  }

  message Channel {
    optional string name = 1;
  }

  required RequestType request_type = 1;

  optional Channel channel = 2;
  optional Auth auth = 4;

  extensions 100 to 199;
}

When I try to extend in extension.proto:

import "base.proto";

extend Request {
  required string name = 100;
}

Loading extension.proto and encoding anything always results in blank messages being encoded, causing the decode to fail since required fields are missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment