RicoSuter / NSwag

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

Date-Time format used in query parameters is incorrect #2795

Open adamjones1 opened 4 years ago

adamjones1 commented 4 years ago

Date-times in OpenAPI should always be date-time as defined here: https://tools.ietf.org/html/rfc3339#section-5.6. However when date-times are serialised into query parameters they use format string "s" which gives yyyy-MM-ddTHH:mm:ss, omitting the offset. The offset is required for the format and in my case I have an API which NSwag does not work for because it rejects invalid formats with a 400.

Can we please switch the format string used from "s" to "O"?

RicoSuter commented 4 years ago

I think it makes sense to change that if it's according to the spec. Can you create a PR?