Summary
In this chapter, you have learned that it's possible to use nullable data types in Protobuf messages. Even though nullable data types aren't natively available in Protobuf, they can be added to it by importing wrapper data types from Google's library of well-known types.
You have also learned that although there is no native support for time and duration data in Protobuf, there are Timestamp
and Duration
data types that have been designed specifically for this purpose. These data types need to be imported into your Protobuf definitions individually.
You now also know that although it is possible to create a Protobuf message
definition with no fields, the library of well-known types already has a standardized message
definition specifically to be used as an empty object. Unsurprisingly, it is called Empty
.
We have also covered two ways you can use loosely typed fields in Protobuf. There is the Any
data type, which you can use to assign any arbitrary message...