How to handle adding new field / partial data update for a gRPC API?

Assuming we have following message that will be used to update data and it just got updated to version 2.

message HelloRequest {   string name = 1; // version 1   bool is_valid = 2; // version 2 } 

Now assuming we updated our apps like so:

  • server : version 2
  • client A : version 2
  • client B : version 1

We don’t have any problems with client A since it can set the proper is_valid value. The issue is that client B will always send a message with is_valid set to false. Is there any techniques such that the server won’t use the is_valid field if it’s from a version 1 client?

In a RESTful API, I could use PATCH to partially update data. That is, the JSON data will not have the is_valid field, so the server can choose not to change the said field.

Our server will be written in C#, not sure if that needs to be considered with this question.