geeklearningio / gl-swagger-generator

Jane - An OpenAPI Specification (formerly Swagger) Client Generator
MIT License
6 stars 1 forks source link

Api with Parameter of type DateTime generates parameter with type DateTimeOffset #50

Closed minuz closed 6 years ago

minuz commented 6 years ago

Hi guys,

On my api method I have a parameter type of DateTime, on the generated client it changes to DateTimeOffset.

Normally that wouldn't be a problem. However, I have a generic implementation such as

   var convertedValue = Convert.ChangeType(paramValue, parameter.ParameterType, System.Globalization.CultureInfo.InvariantCulture);
   parameterValues.Add(convertedValue);

And it throws exception because DateTimeOffset does not implement IConvertible

The type should be a developer's choice instead of being enforced by the generator. Cheers.

sandorfr commented 6 years ago

yes there are some needs around datetime format handling both in C# and typescript languages. I want to federate all feedbacks around that in one place.