Quiz
- Where can you find the proto files for the well-known types?
- Nowhere; this is hidden inside the Protobuf language.
- Nowhere; we need to define them ourselves.
- On the GitHub repository under the
src/google/protobuf
folder.
- Where can you find the message definitions for the option types?
- On the GitHub repository under the folder
src/google/protobuf
in the file calleddescriptor.proto
. - Nowhere; this is hidden inside the Protobuf language.
- Nowhere; we need to define them ourselves.
- On the GitHub repository under the folder
- Why do we define an
UNSPECIFIED
value in enums forproto3
?- In
proto3
, enums are closed, so we do not need to. - In
proto3
, enums are open, andUNSPECIFIED
is used as the default value. - It is not needed in
proto3
, only inproto2
.
- In
- When do we need nesting types inside a message?
- When we want to specialize a type with fully qualified names.
- When a type is only relevant in the parent context.
- All the above.