Hi,
 I'm working on a gRPC validator where I need to validate the size of the 
client's variant fields. 
For example, if the clients have this message:

---- 
message int64{ int64 int64 = 1; int32 int32 = 2; }

----

and the server has this message:
----  
message int64{ bool int64 = 1; bool int32 = 2; }
----  

I want to validate that the client is sending a value that has 1 byte, and 
with the value 1 or 0, and if not raise an error.



When sending the value:
----  
11000010001010110000000010 (0x0308ac02)
----  

(which translate to: field_number :1 wire_type : 0 compile_type : "uint64" 
data : 300)


The type that the server sees for this field is FieldDescriptor::TYPE_BOOL 
and using the function GetBool  (const Message& message, 
const FieldDescriptor* field) return 1.

Is there any way to get the size of the variant field? or get the bytes 
themselves from the msg for each field? If not there is some other way to 
validate that the type of the server and the client is really the same one?

Thanks, Bar Sharvit

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/edc33589-3ad5-408c-987f-147e00351fa6n%40googlegroups.com.

Reply via email to