code: func (cat *catalog) validateJobProto(ctx *validation.Context, j *messages.Job) proto.Message {
  	if j.Id == "" {
  		ctx.Errorf("missing 'id' field'")
  	} else if !jobIDRe.MatchString(j.Id) {
  		ctx.Errorf("%q is not valid value for 'id' field", j.Id)
  	}
  	if j.Schedule != "" {
  		ctx.Enter("schedule")
  		if _, err := schedule.Parse(j.Schedule, 0); err != nil {
  			ctx.Errorf("%s is not valid value for 'schedule' field - %s", j.Schedule, err)
  		}
  		ctx.Exit()
  	}
  	cat.validateTriggeringPolicy(ctx, j.TriggeringPolicy)
  	return cat.validateTaskProto(ctx, j)
  }
docs: // validateJobProto validates messages.Job protobuf message.
  //
  // It also extracts a task definition from it (e.g. SwarmingTask proto).
  // Errors are returned via validation.Context.