[BUG][dart-dio] optimize parameterToString to convert DateTime correctly
Created by: ahmednfwela
Description
Currently DateTime is being converted to string using normal .ToString() Ref: https://github.com/OpenAPITools/openapi-generator/blob/c3220848f24bbc5e5441f53846916eaa82e6673c/modules/openapi-generator/src/main/resources/dart-dio/api_util.mustache#L6-L14
instead, toIso8601String
should be used
openapi-generator version
V5.0.0
Suggested fix:
if (value == null) {
return '';
} else if (value is String || value is num) {
return value.toString();
} else if (value is DateTime) {
return value.toIso8601String();
} else {
return json.encode(serializers.serialize(value));
}