Make input and additionalInput optional in StepRequestBody
Updated the StepRequestBody class to allow both 'input' and 'additionalInput' to be optional. Added logic in toJson() method to return an empty JSON object if both fields are null.pull/5167/head
parent
ef2d64513b
commit
a7c37da713
|
@ -1,10 +1,13 @@
|
|||
class StepRequestBody {
|
||||
final String input;
|
||||
final String? input;
|
||||
final Map<String, dynamic>? additionalInput;
|
||||
|
||||
StepRequestBody({required this.input, this.additionalInput});
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
if (input == null && additionalInput == null) {
|
||||
return {};
|
||||
}
|
||||
return {'input': input, 'additional_input': additionalInput};
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue