Skip to content
protobuf.com

Practice

Protobuf Practice

Edit the schema, wait for the descriptor checks, and continue when everything passes.

Progress

Exercise 6: Field Presence

6. 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

Please satisfy all checks above