-
Notifications
You must be signed in to change notification settings - Fork 28
Maps are not generated properly #6
Comments
I need this too. Also seems "repeated" and "oneof" fields aren’t generated properly either. |
It seems repeated fields are fine, but oneofs and maps are missing. These are both protobuf 3 features. This is the first time I’ve ever used Dusty templates. I don’t fully see their value in this case – I’ve got to look at how to split the logic between the command.ts and the templates. I’m pretty tempted to just remove Dusty and put it all in Typescript. |
Hei, |
Done, works for me. Not tested extensively with different types of keys. I ended up keeping Dusty, once I found how to add simply if statements. Just not sure how much repetition it’ll lead to, if maps are implemented in get/set methods. |
Well, I should have looked earlier – there’s a fork that already has support for proto3 maps: https://github.com/michelgb/Proto2TypeScript/blob/master/templates/interface.dust It’s very similar to my implementation, but more complete. Might need to have a look at it and consider merging it instead. |
This can be closed now that #8 is merged. |
Hello. I notice maps are not properly converted to typescript definitions. For example.
map<string, int32> attr1 = 1;
should convert to
attr1 { [key: string]: number }
The text was updated successfully, but these errors were encountered: