-
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
Skip object check for types with a defined custom wrapper. #1271
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not an owner, but tested this patch works perfectly for defining StringValue wrapper for examples
see #677 (comment)
@alexander-fenster, @JustinBeckwith, do you think you guys or another contributors could review and merge this? |
@nicolasnoble any chance you could look at this PR? It is a quick fix and solves some interesting issues. see my comment here see #677 (comment) |
Please merge this 🙏 |
@dcodeIO or @alexander-fenster any chance this could get some love? It's a dependency of work arounds like: |
@dcodeIO @alexander-fenster @bcoe Review please |
I know pings are annoying @dcodeIO / @alexander-fenster / @gitjuba but FWIW I'm the maintainer of ts-proto, and have pre-reviewed / :+1: this super-small patch. We'd like to see this merged b/c it allows us to support modeling Currently we already support this for our own encoder methods, but a number of our users use NestJS, which goes through grpcjs to @grpcjs/proto-loader, and proto-loader really wants to go through protobufjs's Usually we can use protobufjs's Except for non-object primitives, due to this one extra-cautious Lmk if you have questions or concerns. Thanks! |
Hi guys! Is there any chance that this can be merged? |
We really need this change |
Any way to get it merged? |
This simple PR that will help many people hasn't been merged or even reviewed for 5 years now 😢 |
This PR would give the ability to pass a primitive value for a non primitive type as long as a custom wrapper is defined for it.
Use Case
We would like to be able to define fields that can be multiple different primitive types, however the library currently will throw an error if a message field resolves to a type and the value is not an object. If a custom wrapper is defined for that type, then it should be assumed that the wrapper will handle serialization.
Message:
Protobuf Wrapper: