Skip to content

Instantly share code, notes, and snippets.

@Darkle
Last active February 10, 2024 10:26
Show Gist options
  • Save Darkle/7d038a6b458656be525eeda0f608b661 to your computer and use it in GitHub Desktop.
Save Darkle/7d038a6b458656be525eeda0f608b661 to your computer and use it in GitHub Desktop.
let generateOpenApiClient () =
let openApiClientFileStr =
$"""
(**
⚠️ ⚠️ IMPORTANT! This file is auto-generated. You should _NOT_ edit this file by hand
as any changes you make will be overwritten!
**)
module OpenApiClient
open SwaggerProvider
let [<Literal>] OpenApiSchema = "http://localhost:{postGrestPort}"
type API = OpenApiClientProvider<OpenApiSchema>
let client = API.Client()
"""
let outPutFilePath =
Path.Combine(Directory.GetCurrentDirectory(), "generated", "OpenApiClient.fs")
File.WriteAllText(outPutFilePath, openApiClientFileStr.ToString())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment