Open fryorcraken opened 2 years ago
I'm not sure what a good solution to this is. The generator could have a list of built in type names that it would rename if encountered, but that might be surprising to the user?
Is it a big deal to rename the type in your .proto
file since the format on the wire would be the same?
I'm open to suggestions.
It seems reasonable to document the fact that Error
is a reserved word, so the TypeScript error is expected behavior. We should also point out the workaround that you can rename the type in your .proto file, without breaking the wire format.
Caveat: I'm new to this project, so this may be completely wrong.
It seems reasonable to document the fact that
Error
is a reserved word, so the TypeScript error is expected behavior. We should also point out the workaround that you can rename the type in your .proto file, without breaking the wire format.
Yes, this seems to be the appropriate way. Ensuring it's clearly described in readme so there is no time wasted. I would not go down the route of engineering this one. I open the issue more for doc purposes so that the next user does not end up confused by this error.
Using the following protobuf definition:
The TypeScript generated has the following typescript error:
This is because typescript thinks that
Error
refers to the enum and not to the native typeError
: