RicoSuter / NSwag

The Swagger/OpenAPI toolchain for .NET, ASP.NET Core and TypeScript.
http://NSwag.org
MIT License
6.62k stars 1.23k forks source link

Client formats date time to US-format date time string #4804

Open manzanotti opened 4 months ago

manzanotti commented 4 months ago

Apologies if I've missed something simple here, I'm sure I must have.

I am using NSwag in a .Net 8 project to create a JSON definition that I am then using to automatically create an REST API client in a .Net Framework 4.8 project (as part of how I'm migrating data to the .Net 8 microservice).

I have an object that has a DateTime property. It is set to UTC , and I must admit that I was expecting it to be serialized to an ISO date time format.

However, it is being sent over as a US-format mm/dd/yyyy string, which my .Net 8 Web API endpoint is treating as a UK-format date.

How can I get it to be sent over as an ISO formatted date time?