Import Swagger generator (#15)

This commit is contained in:
Patrick Stevens
2024-10-08 08:47:21 +01:00
committed by GitHub
parent b9761f6dee
commit bbc92a0478
18 changed files with 74812 additions and 10 deletions

View File

@@ -5,7 +5,7 @@ type internal DesiredGenerator =
static member Parse (s : string) =
match s with
| "HttpClient" -> DesiredGenerator.HttpClient None
| "HttpClient(true)" -> DesiredGenerator.HttpClient (Some true)
| "HttpClient(false)" -> DesiredGenerator.HttpClient (Some false)
| _ -> failwith $"Failed to parse as a generator specification: %s{s}"
| "HttpClient" -> DesiredGenerator.HttpClient None |> Some
| "HttpClient(true)" -> DesiredGenerator.HttpClient (Some true) |> Some
| "HttpClient(false)" -> DesiredGenerator.HttpClient (Some false) |> Some
| _ -> None

View File

@@ -968,7 +968,7 @@ type HttpClientGenerator () =
desired
|> List.tryPick (fun generator ->
match generator with
| DesiredGenerator.HttpClient arg ->
| Some (DesiredGenerator.HttpClient arg) ->
let spec =
{
ExtensionMethods =
@@ -978,6 +978,7 @@ type HttpClientGenerator () =
}
Some (typeDef, spec)
| None -> None
)
| _ -> None
| Some attr ->