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
I have searched here and grpc issues list, and see some related post, but none with an answer. so I posted my question here.
I have grpc server use the grpc/node library. when it received bytes contains enum. tt converts enum to string. it caused protobuf.js Message.verify() to fail. I use verify as an input validation mechnism. Looks like the verify method is looking for int32. Lets say I have the following proto file.
when I send a user object like
{
Id: '1',
Status: 1
}
I will receive on my grpc server as
{
Id: '1',
Status: 'Inactive'
}
then I use verify() to validate the message, it will return error message like 'Status: enum value expected', so is there a way to by pass this issue still with the verify method. Any input would be appreciated.
proto.file
syntax = "proto3";
package test;
message User {
string Id = 1 ;
UserStatus Status = 4;
}
enum UserStatus {
Active = 0;
Inactive = 1;
}
The text was updated successfully, but these errors were encountered:
protobuf.js version: v6.8.0
I have searched here and grpc issues list, and see some related post, but none with an answer. so I posted my question here.
I have grpc server use the grpc/node library. when it received bytes contains enum. tt converts enum to string. it caused protobuf.js Message.verify() to fail. I use verify as an input validation mechnism. Looks like the verify method is looking for int32. Lets say I have the following proto file.
when I send a user object like
{
Id: '1',
Status: 1
}
I will receive on my grpc server as
{
Id: '1',
Status: 'Inactive'
}
then I use verify() to validate the message, it will return error message like 'Status: enum value expected', so is there a way to by pass this issue still with the verify method. Any input would be appreciated.
proto.file
syntax = "proto3";
package test;
message User {
string Id = 1 ;
UserStatus Status = 4;
}
enum UserStatus {
Active = 0;
Inactive = 1;
}
The text was updated successfully, but these errors were encountered: