-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 typescript file is not usable anymore #834
Comments
Messages with optional fields will now implement their corresponding interfaces (IMessage) fixes protobufjs#834 fixes protobufjs#837
Messages with optional fields will now implement their corresponding interfaces (IMessage) fixes protobufjs#834 fixes protobufjs#837
Hi, I'm facing this problem, too. Have you found any workaround for this? |
@dcodeIO I think this is very important because currently there is no easy way to get the interface from the class. |
Does this issue still exist in master? There have been a couple merges that might, or might not, prevent this. Otherwise, do you have an updated example causing the issue? |
6.8.3 still reproducable.
Actually I don't understand why these interfaces were added. They add additional noise and doesn't bring anything new to the app. |
What about 6.8.4 (the version on npm)? Btw. the interfaces are there because messages can be plain objects as well, without any methods but just data. |
@dcodeIO - are interfaces for data that's to be sent and classes for data that is being received? Is that an ok rule of thumb? |
I have the same issue with |
protobuf.js version: 6.8.0
Here's a part of my proto file:
Here's a part of generated typescript file using pbts:
You see that optional fields Document, Content, MeetingId have different types which makes this classes incompatible and this unusable. Class doesn't implement interface.
Expected behavior:
Interface and class should have same propeties. Probably it even makes sense to make class implement interface.
Also I don't understand why this:
properties?: MyPhone.Notifications.IRequestUpdateDocument
If we can make
properties?: Partial<MyPhone.Notifications.RequestUpdateDocument>
The text was updated successfully, but these errors were encountered: