You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
encode(message: Parent, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.name !== "") {
writer.uint32(10).string(message.name);
}
if (message.value !== undefined) {
Value.encode(Value.wrap(message.value), writer.uint32(18).fork()).join(); // <--- here
}
return writer;
}
null value is not wrapped, so server receives null instead of NullValue.
Could you please support correct handling of null values in fromPartial?
The text was updated successfully, but these errors were encountered:
simonenkoav
changed the title
google.protobuf.Value NullValue is replaced by undefined fromPartial method of parent message
google.protobuf.Value NullValue is replaced by undefined in fromPartial method of parent message
Nov 19, 2024
Honestly it sounds like you've done a great job of dissecting what is going wrong--if you could turn those insights into a PR that fixes the issue, that would be amazing!
Sorry for the late reply, and the ask for a PR, but that's just realistically how ts-proto keeps evolving/getting better, is our users turning into contributors (even if it's only for one-time PRs) and slowly helping it get better and better. Thanks!
We have proto message
Parent
like this:and ts-proto generates this:
When request is sent to the server
fromPartial
method is called, I guess generation for this is here:ts-proto/src/generate-grpc-web.ts
Line 78 in 37d3a39
which looks like this:
so
value=null
is replaced byundefined
(I guess because of this linets-proto/src/main.ts
Line 2646 in 37d3a39
Parent.encode
:null value is not wrapped, so server receives null instead of NullValue.
Could you please support correct handling of null values in
fromPartial
?The text was updated successfully, but these errors were encountered: