Skip to content

Protobuf Practice

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

Progress

Exercise 5: Field Presence

5. Field Presence

Context
In proto3 a scalar at its default value is omitted from the wire, so a receiver cannot tell false from unset. Explicit presence fixes that.
Task

Add explicit field presence tracking to the is_admin field.

schema.proto
Valid Schema
syntax = "proto3";

package practice;

message UserSession {
  string username = 1;
  bool is_admin = 2;
}
Evaluation checks
Field 'is_admin' uses the 'optional' keyword for presence.

Exercise Incomplete

Checks remaining above