Map<String, dynamic> toJson() => { 'name': name, if (inputs.isNotEmpty) 'inputs': inputs, if (expectError != null) 'expectError': expectError, };