diff --git a/docs/RELEASE_NOTES.md b/docs/RELEASE_NOTES.md index 7a101cd..69ed8ac 100644 --- a/docs/RELEASE_NOTES.md +++ b/docs/RELEASE_NOTES.md @@ -1,3 +1,7 @@ +#### 2.1.2 - Jun 3, 2024 + + - fix: Support DateTime/DateTimeOffset as required query parameter, using round-trip format (#244) + #### 2.1.1 - Apr 8, 2024 - Minor dependency updates diff --git a/src/SwaggerProvider.Runtime/RuntimeHelpers.fs b/src/SwaggerProvider.Runtime/RuntimeHelpers.fs index 07867b8..885ed8c 100644 --- a/src/SwaggerProvider.Runtime/RuntimeHelpers.fs +++ b/src/SwaggerProvider.Runtime/RuntimeHelpers.fs @@ -110,6 +110,8 @@ module RuntimeHelpers = | :? Option as x -> x |> toStrOpt name | :? Option as x -> x |> toStrDateTimeOpt name | :? Option as x -> x |> toStrDateTimeOffsetOpt name + | :? DateTime as x -> [ name, x.ToString("O") ] + | :? DateTimeOffset as x -> [ name, x.ToString("O") ] | :? Option as x -> x |> toStrOpt name | _ -> [ name, (if isNull obj then null else obj.ToString()) ]