required static method

String required(
  1. OperationInput step,
  2. String operation
)

Implementation

static String required(OperationInput step, String operation) {
  final value =
      step.arguments['name']?.toString() ?? step.arguments['key']?.toString();
  if (value == null) {
    throw EnsembleTestFailure(
      '$operation requires "${operation.startsWith('expectApi') ? 'name' : 'key'}"',
    );
  }
  return value;
}