Converts to JSON.
Map<String, dynamic> toJson() => { if (input != null) 'input': input!.toJson(), if (output != null) 'output': output!.toJson(), };