geeklearningio / gl-swagger-generator

Jane - An OpenAPI Specification (formerly Swagger) Client Generator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Api with Parameter of type DateTime generates parameter with type DateTimeOffset

minuz opened this issue · comments

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.

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.