GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - fsprojects/SwaggerProvider: F# generative Type Provider for Swagger

BranchesTags
Open more actions menu

Latest commit

 

History

799 Commits
799 Commits

Folders and files

NameName
Last commit message
Last commit date
.config
.config
 
 
.github
.github
 
 
docs
docs
 
 
src
src
 
 
tests
tests
 
 
.editorconfig
.editorconfig
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
AGENTS.md
AGENTS.md
 
 
LICENSE.txt
LICENSE.txt
 
 
README.md
README.md
 
 
SwaggerProvider.TestsAndDocs.sln
SwaggerProvider.TestsAndDocs.sln
 
 
SwaggerProvider.sln
SwaggerProvider.sln
 
 
build.cmd
build.cmd
 
 
build.fsx
build.fsx
 
 
build.sh
build.sh
 
 
global.json
global.json
 
 
paket.dependencies
paket.dependencies
 
 
paket.lock
paket.lock
 
 

Repository files navigation

SwaggerProvider

NuGet Version NuGet Downloads License: Unlicense

SwaggerProvider is an F# library of generative Type Providers that auto-generate strongly-typed HTTP client code from OpenAPI 3.0 and Swagger 2.0 schemas — no code generation step required.

📚 Full documentation: https://fsprojects.github.io/SwaggerProvider/

Quick Start

#r "nuget: SwaggerProvider"
open SwaggerProvider

let [<Literal>] Schema = "https://petstore.swagger.io/v2/swagger.json"
type PetStore = OpenApiClientProvider<Schema>

let client = PetStore.Client()
client.GetInventory() |> Async.AwaitTask |> Async.RunSynchronously

Features

  • Compile-Time Types — generated at compile time directly from live or local schema files, no separate codegen step needed
  • Supports OpenAPI 3.0 and Swagger 2.0 schemas in JSON and YAML formats
  • Works Everywhere — F# scripts, .NET projects, and F# Interactive with full IntelliSense and type-checking
  • SSRF Protection — blocks HTTP and private IP addresses by default to prevent server-side request forgery attacks
  • CancellationToken Support — every generated method accepts an optional CancellationToken for cancelling long-running requests
  • Fully Customizable — bring your own HttpClient, DelegatingHandler, or override JSON serialization

Installation

dotnet add package SwaggerProvider

Key Parameters

Parameter Default Description
Schema (required) URL or file path to the OpenAPI/Swagger schema
SsrfProtection true Block HTTP and private IPs to prevent SSRF attacks
PreferNullable false Use Nullable<_> instead of Option<_> for optional fields
PreferAsync false Generate Async<'T> instead of Task<'T>
IgnoreControllerPrefix true Generate a single client class for all operations
IgnoreOperationId false Generate method names from paths instead of operation IDs
IgnoreParseErrors false Continue generation even when the parser reports schema warnings

See the full documentation for more details and examples.

Maintainer(s)

  • @sergey-tihon

The default maintainer account for projects under "fsprojects" is @fsprojectsgit — F# Community Project Incubation Space.

About

F# generative Type Provider for Swagger

fsprojects.github.io/SwaggerProvider/

Topics

fsharpopenapiopenapi2openapi3swaggertypeprovider

Resources

Readme
Unlicense
Activity
Custom properties

Stars

278 stars

Watchers

8 watching

Forks

60 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.