-
Notifications
You must be signed in to change notification settings - Fork 349
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
Release updated ts-proto-descriptors? #1042
Release updated ts-proto-descriptors? #1042
Comments
Okay, @bhollis I did the basic minimum of bumping ts-proto-descriptors--is that going to do what you want? I'm slightly curious if we should have turned on a proto2-specific build option, but I'm not sure. Thanks! |
🎉 This issue has been resolved in version 1.176.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Thanks for doing that! Unfortunately I was wrong - it wasn't as simple as just releasing the newest version. Even when removing toJSON(message: EnumValueDescriptorProto): unknown {
const obj: any = {};
- if (message.name !== "") {
+ if (message.name !== undefined && message.name !== "") {
obj.name = message.name;
}
- if (message.number !== 0) {
+ if (message.number !== undefined && message.number !== 0) {
obj.number = Math.round(message.number);
}
if (message.options !== undefined) { You can see that the optional fields aren't set when the value is not undefined, when I think they should be. I can switch over to Thanks for the project! If I get some free time I might try to file a PR to fix this, though I have some other things I'd probably want to try first. |
Since v1.169.0,
proto2
optional fields are better supported. Since Google'sdescriptors.proto
isproto2
syntax, this should fix several issues with encoding descriptors usingts-proto-descriptors
- for example, since it won't write out optional fields, it's impossible to make anEnumValueDescriptorProto
that describes the zero-value option.I think what's required is to bump the version of
ts-proto-descriptors
, build it with the latestts-proto
, and publish.The text was updated successfully, but these errors were encountered: