Open kamilslusarczyk opened 4 years ago
What is the "format" and "type" in the spec?
Bold: Can ignore for now; it appears upgrading and clearing the autogenerated client code resolved ths issue. Leaving my comment, just in case.
@RicoSuter We're also experiencing this issue; a sample of a field with this issue in the open api JSON schema:
"contactConsentExpirationDateTime": {
"type": "string",
"format": "date-time",
"nullable": true
},
Similarly, tried specifying the date time type explicitly in the generator settings args, still comes back as System.DateTimeOffset.
On 13.7.4.
I'm also having this issue. Why are "date-time" converted to DateTimeOffset? Suggestion: "date-time" -> C# DateTime (as expected) "date-time-offset" -> C# DateTimeOffset ??
Is there anyway we can force to always use C# DateTime for "date-time" type?
You can configure this:
@RicoSuter how do you do that via the command line (as this bug still exists and is technically two bugs)?
Same issue here !
how do you do that via the command line (as this bug still exists and is technically two bugs)?
/DateType:DateTime /DateTimeType:DateTime
just to make @mlaily comment more accurate in case it doesn't work for anyone like me /DateType:"System.DateTime" /DateTimeType:"System.DateTime"
Hi,
I have below class definition:
After generating C# client with below command:
(Other configuration options like URL address, output file name etc. have been ommitted for brevity).
I get an auto-generated client with method definitions containing
DateTimeOffset
class: