toJson method

  1. @override
Map<String, Object?> toJson()
override

The wire form. Keys here are what every surface shows and what an agent parses, so they are part of the action's contract.

Implementation

@override
Map<String, Object?> toJson() => {
  'version': version,
  // Derivable from the packages, and said anyway: `ok` is what a CI step
  // greps a report for, and what the action's exit code is read against.
  'ok': ok,
  // The same reasoning one level down: a red run says *which* without
  // making the reader walk the tree. Absent on a green one.
  if (!ok) 'failed': failed,
  if (axes != null) 'axes': axes,
  if (clock != null) 'clock': clock!.toIso8601String(),
  if (notRun.isNotEmpty) 'notRun': notRun,
  'packages': packages,
};