Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/SwaggerProvider.Runtime/RuntimeHelpers.fs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ module RuntimeHelpers =
| :? array<string> as xs -> xs |> toStrArray name
| :? array<DateTime> as xs -> xs |> toStrArrayDateTime name
| :? array<DateTimeOffset> as xs -> xs |> toStrArrayDateTimeOffset name
| :? array<Guid> as xs -> xs |> toStrArray name
| :? array<Option<bool>> as xs -> xs |> toStrArrayOpt name
| :? array<Option<int32>> as xs -> xs |> toStrArrayOpt name
| :? array<Option<int64>> as xs -> xs |> toStrArrayOpt name
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Swashbuckle.v3.UpdateControllersTests
module Swashbuckle.v3.UpdateControllersTests

open Expecto
open System
Expand All @@ -7,6 +7,8 @@ open Swashbuckle.v3.ReturnControllersTests
[<Tests>]
let returnControllersTests =
let guid = Guid.NewGuid()
let guid2 = Guid.NewGuid()
let guid3 = Guid.NewGuid()
testList "All/v3/Swashbuckle.UpdateControllers.Tests" [

testCaseAsync "Update Bool GET Test" <|
Expand Down Expand Up @@ -104,6 +106,14 @@ let returnControllersTests =
(api.PostApiUpdateArrayEnum([|2;1|])
|> asyncEqual [|1;2|])

testCaseAsync "Update Array Guid GET Test" <|
(api.GetApiUpdateArrayGuid([|guid; guid2; guid3|])
|> asyncEqual [|guid3; guid2; guid|])

testCaseAsync "Update Array Guid POST Test" <|
(api.PostApiUpdateArrayGuid([|guid; guid2; guid3|])
|> asyncEqual [|guid3; guid2; guid|])

//TODO: System.InvalidOperationException: Could not create an instance of type 'Microsoft.FSharp.Collections.FSharpList`1[[System.Int32, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]'. Model bound complex types must not be abstract or value types and must have a parameterless constructor. Alternatively, give the 'x' parameter a non-null default value.
// testCaseAsync "Update List Int GET Test" <|
// (api.GetApiUpdateListInt([|3;2;1|])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ type UpdateArrayIntController () =
type UpdateArrayEnumController () =
inherit UpdateController<UriKind []>(Array.rev)

type UpdateArrayGuidController () =
inherit UpdateController<Guid []>(Array.rev)

type UpdateListIntController () =
inherit UpdateController<int list>(List.rev)

Expand Down