Skip to content
protobuf.kmcd.dev

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 field with its default value is usually omitted from the wire. For a boolean, that means a receiver cannot distinguish `false` from not set unless the field has explicit presence.
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