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

TS Typings: Class properties should be of type Message, not Message$Properties #746

Closed
foxdavidj opened this issue Apr 4, 2017 · 2 comments

Comments

@foxdavidj
Copy link
Contributor

message FooMessage {
  bool my_bool = 1;
  repeated BarMessage bars = 2;
}

message BarMessage {
  string my_string = 1;
}

Right now FooMessage.bars is of type BarMessage$Properties[] which has the unfortunate side-effect of FooMessage.bars[0].my_string being of type string|undefined when it should be of type string.

  1. Would changing the typings from Message$Properties to just Message be an acceptable fix? OR
  2. Should we duplicate the Message$Properties interface and create two versions? One with optional props and one without optional props?
@dcodeIO
Copy link
Member

dcodeIO commented Apr 4, 2017

Related: #741

There is a new command line option --force-message in master now that does exactly this.

@foxdavidj
Copy link
Contributor Author

Works great. Thanks

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

2 participants