Skip to content

Protobuf Practice

Edit the schema and the descriptor checks run as you type. Continue when everything passes.

Progress

Exercise 6: Oneof

6. Oneof

Context
A notification target can be identified by either a user_id or an email, but not both.
Task

Group user_id and email inside a oneof block named identifier.

schema.proto
Valid Schema
syntax = "proto3";

package practice;

message NotificationTarget {
  string user_id = 1;
  string email = 2;
}
Evaluation checks
A oneof block named 'identifier' is declared.
Both 'user_id' and 'email' fields are members of the 'identifier' oneof.

Exercise Incomplete

Checks remaining above