Skip to content

Releases: fsprojects/SwaggerProvider

v4.0.0 "Nova"

16 May 18:11

Choose a tag to compare

This major release introduces significant performance optimizations, cleaner code generation, enhanced documentation integration via XmlDoc, and support for modern .NET types (DateOnly, TimeOnly).


⚠️ Breaking Changes

  • Legacy Provider Removal: Removed the legacy SwaggerClientProvider and the v2 compiler. The ecosystem has been streamlined to focus entirely on the modern v4 architecture (#377).
  • Optional Scalar Reference Types: Optional scalar reference types are now wrapped in Option<T> for safer, more idiomatic F# handling (#357).

🚀 New Features & Enhancements

📅 Modern .NET Type Support

  • Added native support for TimeOnly values. When UseDateOnly=true is enabled, format: time now maps directly to System.TimeOnly (#394).
  • Fixed serialization handling for DateOnly and TimeOnly across query parameters, form-url-encoded payloads, and multipart form data (#393, #395).

📝 Richer IDE Documentation (XmlDoc)

  • Schema Descriptions: OpenAPI schema descriptions are now surfaced as XmlDoc on generated object and enum types, providing inline documentation in your IDE (#419).
  • Response Descriptions: Added <returns> XML tags to generated operation methods, surfacing response details directly at the call site (#420).
  • Enum Parameters: Allowed enum values are now automatically listed in the generated documentation for operation parameters (#398).

🏗️ Code Generation Improvements

  • Top-Level Enums: The compiler now generates standard CLI enum types for top-level named enum schemas (#409).
  • Polymorphism Resolution: Improved resolution for oneOf/anyOf schemas when they contain a single $ref to a referenced type (#375).

⚡ Performance Optimizations

This release includes major under-the-hood performance tuning to maximize execution speed and significantly minimize memory allocations:

  • Zero-Allocation XML Escaping: Integrated a fast-path in XmlDoc compilation to skip memory allocations entirely when no XML-specific characters are present (#429).
  • Efficient URL & Request Building: Added optimized fast-paths for string concatenation and skipped redundant UriBuilder allocations for HTTP requests without query parameters (#433).
  • Parameter Fast-Paths: Added direct serialization fast-paths for standard primitive types (string, int32, int64, bool) (#435).
  • Reflection & Metadata Caching: Implemented widespread caching for type lookups, HTTP methods, and reflection data (such as union tags and property metadata) to drastically cut down execution overhead on hot paths (#373, #374, #399, #412, #415).

v3.2.0 - Cancellation & Performance

06 Apr 09:45

Choose a tag to compare

  • feat: add CancellationToken support to OpenApiClientProvider generated methods (closes #212) (#336)
  • fix: map format:date to DateOnly on .NET 6+ targets (closes #240) (#321)
  • fix: throw OpenApiException for undocumented HTTP error codes (#354)
  • improve: enrich XML documentation for generated API methods (#349)
  • improve: add allowed enum values to generated property XmlDoc comments (#353)
  • perf: reduce DLL-emit time for large schemas (shared ToString helper + Dictionary lookup) (#356)
  • perf: update FSharp.TypeProviders.SDK (O(n^2) to O(n) ILMethodDefs) (#355)
  • test: add v3 array/map type-mapping tests and v2 schema compilation tests (#351)
  • test: add $ref primitive-type alias tests for v3 DefinitionCompiler (closes #335) (#342)
  • hk: update TP SDK and OpenApi reader

v3.1.0 - Repo Assisted

22 Mar 19:43

Choose a tag to compare

  • feat: Add IgnoreParseErrors parameter to OpenApiClientProvider (#300)
  • feat: Add SchemaReaderErrors property to OpenApiClientProvider (fixes #160) (#327)
  • fix: include response body in OpenApiException message (closes #250) (#324)
  • fix: unwrap F# Option<T> in toParam for header/path/cookie parameters (closes #140) (#322)
  • fix: 2xx response handling in v2 and v3 OperationCompilers (#313)
  • fix: $0 in path parameter values treated as regex back-reference (#310)
  • fix: Option types in form data not being unwrapped (issue #214) (#298)
  • perf: avoid redundant cache invalidation timers in GetOrAdd (#318)
  • perf: increase type provider cache timeout from 30s to 5 minutes (#329)
  • hk: update FSharp.TypeProviders.SDK (enum custom attribute bug fix) (#330)
  • test: add v3 DefinitionCompiler type-mapping unit tests (#331)
  • test: add UniqueNameGenerator unit tests (#319)
  • test: add unit tests for RuntimeHelpers module (#295)
  • ci: add concurrency group to CI workflow to cancel redundant builds (#309)

2.0.0 - Tasks under the hood

15 Nov 15:57

Choose a tag to compare

  • F# 6 task{} instead of async{} under the hood - #200
  • BREAKING: ProvidedApiClientBase.CallAsync returns task instead of async
  • BREAKING: task CE wrap all exceptions in AggregateException (with OpenApiException inside)
  • Model enums as string, int32 or boolean (Fixed #186 )
  • Add Accept header to all requests (Fixed #196)
  • Supported requests with octet-stream body content #203
  • Added missing properties to OpenApiException #222
  • Changed raise to calling Reraise() extension method to preserve the call stack #230
  • Microsoft.OpenApi (1.6.10)
  • FSharp.SystemTextJson (1.2.42)
  • Removed the System.Net.Http dependency (#221)
  • fix: accept "default" as "ok response" fallback (#223)
  • Minor performance tweaks (#233)

.NET 6

17 Apr 15:39

Choose a tag to compare

  • Target .NET 6
  • Microsoft.OpenApi v1.3.1
  • Migration to System.Text.Json #176
  • Fix for 'FS3033: Payload is not supported' #181
  • Drop net46 support
  • Dependencies update

OpenApiClientProvider and .NET Core 3.1 support

08 Dec 19:13

Choose a tag to compare

  • Migration to new Type Provider SDK #88 #125
  • SwaggerParser moved to runtime assembly (and exposed as API to library users) - #90
  • Added runtime dependency on YamlDotNet
  • Removed dependency on FSharp.Data/JsonValue (replaced by JSON.NET)
  • Added full-init constructor for provided types #91
  • Option/Nullable types for not required properties #93
  • Http.fs is moved to SwaggerProvider.Runtime.dll and nicePascalName applied to provided types, because FSI cannot load types with special characters in name (like [ and ]) - fix for #94
  • Provide namespaces as nested types #96
  • Added ability to generate multiple clients (one per controller) This feature is turned off by default and is controlled by IgnoreControllerPrefix parameter #45
  • Supported parsing of schemas with inheritance in types defined inside operation parameters
  • Added Async & Task-based calls for the Operations #21
  • Do not reference design-time assembly when install from nuget #104
  • Migration to HttpClient-based communication #105 #100
  • Fixed null reference in query params #126
  • OpenApiClientProvider #117
  • TP parameter names are unified #129
  • Support REST convention with pluralized entities in mode with IgnoreOperationId=true #121
  • Fixed null refs in optional headers #123
  • Delete method incorrectly cased #120
  • File handling - upload/download files as IO.Stream #131
  • DateTimeOffset as a default date-time type #133
  • Custom OpenApiException instead of HttpRequestException 134
  • Fixed null reference for schemas without Components definitions
  • UUID/Guid support #138

0.8.1

21 Aug 19:41

Choose a tag to compare

Removed caching and dependency on FSharp.Configuration context #84

0.5.7

12 Mar 19:00

Choose a tag to compare

  • Improved URL construction #66

0.5.6

31 Aug 14:23

Choose a tag to compare

  • Added NTLM auth for schema request #50

0.5.5

20 Aug 21:44

Choose a tag to compare

  • Allow to configure protocol together with host name #41