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

Generated protobuf messages require a value #169

Open
peschkaj opened this issue Sep 1, 2013 · 0 comments
Open

Generated protobuf messages require a value #169

peschkaj opened this issue Sep 1, 2013 · 0 comments

Comments

@peschkaj
Copy link
Contributor

peschkaj commented Sep 1, 2013

Generated protocol buffers messages require a value for enums. This appears to be an artifact of how protogen.exe is generating code plus the fact that enums are value types. For example:

enum RpbReplMode {
    FALSE = 0;
    REALTIME = 1;
    FULLSYNC = 2;
    TRUE = 3;
}
optional RpbReplMode repl = 24;

In this scenario, a property for RpbReplMode is generated that looks like:

private RpbBucketProps.RpbReplMode _repl = RpbBucketProps.RpbReplMode.;
[global::ProtoBuf.ProtoMember(24, IsRequired = false, Name=@"repl", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
[global::System.ComponentModel.DefaultValue(RpbBucketProps.RpbReplMode.)]
public RpbBucketProps.RpbReplMode repl
{
  get { return _repl; }
  set { _repl = value; }
}

The code is invalid as generated - there's no default values listed for RpbBucketProps.RpbReplMode, nor should there be since it's optional. Not sure if this is an issue in protogen.exe or in how we're calling it.

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