Skip to content

Releases

NSwag v14.8.0 (NJsonSchema v11.6.2)

Choose a tag to compare

@RicoSuter RicoSuter released this 11 Nov 23:33
9fa77c8

Important

An nswag.json without an explicit runtime field now defaults to Net100 instead of Net80.

.NET 8 reached end of life on 2026-11-10, so the default moved to the active LTS. A document that omits runtime and is executed with $(NSwagExe_Net80) or nswag.cmd /runtime:net80 now fails with:

InvalidOperationException: The specified runtime in the document (Net100) differs
from the current process runtime (Net80).

Either pin the runtime in the document ("runtime": "Net80") or move to $(NSwagExe_Net100) / /runtime:Net100. Documents that already specify runtime are unaffected.

.NET 11 support

.NET 11 reached GA on 2026-11-10 and is now a fully supported NSwag runtime.

Runtime support is additive — net8.0, net9.0, net10.0 and net11.0 all ship. Nothing was removed, so every existing NSwagExe_* property and /runtime: value keeps working.

  • $(NSwagExe_Net110) and $(NSwagDir_Net110) in NSwag.MSBuild
  • /runtime:Net110 in the command line tool, the nswag NPM package (the legacy --core 11.0 form also works) and NSwagStudio
  • A Net110 folder in the MSBuild tools/ layout and in the NPM package

NJsonSchema v11.6.2 (potentially breaking changes)

This release bundles NJsonSchema v11.6.2 and Namotion.Reflection v3.5.1. Two changes there can affect generated output:

  • Swagger2 documents: properties that are both required and nullable now emit x-nullable: true instead of silently losing their declared nullability (NJsonSchema#1931). This applies when the property is marked required by a presence-only marker — the C# required keyword, [JsonRequired], [DataMember(IsRequired = true)] or Newtonsoft Required.AllowNull. [Required] from DataAnnotations is unaffected. C# clients generated from such documents may now produce nullable types where they previously produced non-nullable ones.
  • UseRequiredKeyword = true: default-value initializers are now suppressed only on the properties that actually receive the required keyword, so optional properties regain their initializers (NJsonSchema#1926). The default (UseRequiredKeyword = false) is unaffected.

New C# generator settings also become available: IntegerType, AdditionalPropertiesValueType and PropertyAttributeFactory. See the NJsonSchema v11.6.2 release notes for the full list.

Dependency and security updates

Packages carrying known vulnerability advisories moved to the current servicing release of their line:

  • Microsoft.AspNetCore.* for net462 / netstandard2.0: 2.3.0 (Kestrel.Core 2.3.6) → 2.3.14
  • Microsoft.AspNetCore.OpenApi and .TestHost: 8.0.34, 9.0.23, 10.0.15 and 11.0.0 per target framework
  • Build-only: System.Security.Cryptography.Xml and .Pkcs → 10.0.15

Other changes

  • The release binaries (NSwag.zip and NSwagStudio.msi) are now attached to the GitHub release automatically by the tagged build.
  • A hang in project metadata lookup was fixed: dotnet msbuild --getProperty output was read only after the process exited, which could deadlock, and MSBuild worker nodes kept for reuse could hold the pipes open indefinitely.

What's Changed

  • Fix development build dependencies and TypeScript test compiler by @RicoSuter in #5400
  • docs: add general pull request template by @RicoSuter in #5401
  • Use NuGet trusted publishing instead of a stored API key by @RicoSuter in #5418
  • docs: add AGENTS.md with repository instructions for AI coding agents by @RicoSuter in #5420
  • Add .NET 11 support (v14.8.0) by @RicoSuter in #5419

Full Changelog: v14.7.1...v14.8.0

NSwag v14.7.1 (NJsonSchema v11.6.1)

Choose a tag to compare

@RicoSuter RicoSuter released this 20 Apr 18:58
2389c07

Important

Upgrade directly from v14.6.3 to v14.7.1 — skip v14.7.0.

v14.7.0 bundled NJsonSchema v11.6.0, which contained a regression that silently dropped nullability on required T? / [JsonRequired] T? DTO properties. The resulting OpenAPI/JSON schema marked those properties as non-nullable, so generated TypeScript and C# clients lost null-safety for fields the server can legitimately return as null (#5359).

Corrections to v14.7.0

v14.7.1 updates to NJsonSchema v11.6.1, which corrects the handling of the C# required keyword and [JsonRequired]:

  • These are now treated as presence markers (the property must be present in the JSON) rather than value constraints.
  • Nullability from the declared type (string?, T?) is preserved.
  • No spurious MinLength=1 on non-nullable strings.
  • DataAnnotations [Required] semantics remain unchanged (still suppresses nullability and adds MinLength=1 to strings by default, matching its runtime behavior).

Observable client changes vs v14.7.0

For public required string[]? OptionList { get; init; } (#5359):

TypeScript client C# client
v14.7.0 (broken) optionList: string[] ❌ public string[] OptionList ❌
v14.7.1 optionList: string[] | null ✅ public string[]? OptionList ✅

For full details and truth tables across all required / [Required] / [JsonRequired] / [JsonProperty(Required=*)] combinations, see the NJsonSchema v11.6.1 release notes and NJsonSchema #1919.

What's Changed

Full Changelog: v14.7.0...v14.7.1

NSwag v14.7.0 (NJsonSchema v11.6.0)

Choose a tag to compare

@RicoSuter RicoSuter released this 08 Apr 19:05
b108f11

Caution

Do not use this release — upgrade to v14.7.1 or later.

v14.7.0 bundles NJsonSchema v11.6.0, which contained a regression that silently dropped nullability on required T? / [JsonRequired] T? DTO properties. Generated TypeScript and C# clients lost null-safety for fields the server can legitimately return as null (#5359). Fixed in v14.7.1.


What's Changed

  • Upgrade to NUKE 10 by @lahma in #5310
  • Upgrade to NUKE 10.1.0 by @lahma in #5314
  • Fix specifying runtime for NSwag.Npm resulting in a NConsole.UnusedArgumentException by @ptasev in #5320
  • fix: nullpointer by @MeikelLP in #5337
  • fix axios template: [object Object] is not valid JSON. by @adnanalbeda in #5283
  • Fix legacy document transformation by @copyleftproducts in #5315
  • Fix compile error in generated C# client when media type contains quotes by @bkoelman in #5345
  • Fix duplicate client/operation names when operation IDs contain multiple underscores by @Copilot in #5348
  • Update to NJsonSchema v11.6.0 and Namotion.Reflection v3.5.0 (v14.7.0) by @RicoSuter in #5357

NJsonSchema v11.6.0 (potentially breaking changes)

This release updates to NJsonSchema v11.6.0 and Namotion.Reflection v3.5.0, which include the following changes that may affect generated code:

  • C# 11 required keyword now correctly recognized: Properties using the C# 11 required keyword (via RequiredMemberAttribute / JsonRequiredAttribute) are now properly treated as required in the schema and generated code. Previously these were incorrectly treated as optional.
  • Removed extra blank line before class declarations in generated C# controller code (cosmetic).
  • New WriteAccessor setting to control property setter syntax (set vs init).
  • New JsonLibraryVersion setting for controlling enum attribute generation with System.Text.Json.
  • Fixed MinLength validation no longer incorrectly applied to DateTime properties.
  • Fixed nullable enum array detection for string enum converters.
  • Support for public fields with System.Text.Json when IncludeFields is enabled.

For the full list of changes, see the NJsonSchema v11.6.0 release notes.

New Contributors

Full Changelog: v14.6.3...v14.7.0

NSwag v14.6.3 (NJsonSchema v11.5.2)

Choose a tag to compare

@RicoSuter RicoSuter released this 20 Nov 19:20
b595e3b

What's Changed

New Contributors

Full Changelog: v14.6.2...v14.6.3

NSwag v14.6.2 (NJsonSchema v11.5.2)

Choose a tag to compare

@RicoSuter RicoSuter released this 05 Nov 13:56

Fixes EnumValue regression in v14.6.1 by introducing a new JsonLibraryVersion configuration (default 8.0)

What's Changed

image

Full Changelog: v14.6.1...v14.6.2

NSwag v14.6.1 (NJsonSchema v11.5.1)

Choose a tag to compare

@RicoSuter RicoSuter released this 30 Sep 20:49

What's Changed

New Contributors

Full Changelog: v14.6.0...v14.6.1

NSwag v14.6.0 (NJsonSchema v11.5.0)

Choose a tag to compare

@RicoSuter RicoSuter released this 18 Sep 18:36

What's Changed

  • Update NJS v11.5.0, breaking: minimum TypeScript output version is now 4.3 by @RicoSuter in #5268
  • Add .NET 10 support by @RicoSuter in #5271
  • Fix generating typescript fetch client interfaces when useAbortSignal is false by @htuomola in #5243
  • Add test coverage for some APIs by @lahma in #5244
  • Issue-5239 - Adding K6 template to TypeScript Code Generator by @jsclifford in #5240
  • Fix NPM CLI argument handling by @lahma in #5245
  • #5250 - K6 template for Typescript has errors when void is return type by @jsclifford in #5251
  • Add option to generate code only for selected operation IDs by @amayouf in #5248
  • Add credentials and mode attributes to fetch template generation by @etriebe in #5235
  • Fix for Reusable request bodies are not handled correctly #2747 by @Doomic in #5196
  • Refactor: Inline NConsole with fixes by @RicoSuter in #5272

New Contributors

Full Changelog: v14.5.0...v14.6.0

NSwag v14.5.0 (NJsonSchema v11.4.0)

Choose a tag to compare

@RicoSuter RicoSuter released this 02 Aug 22:36
bc75a1e

What's Changed

  • Better support for reading yaml from a stream by @simonthum in #5170
  • #4821 Cleanup packages to use those provided by framework by @thompson-tomo in #4831
  • Set GH actions target .NET SDK to 9.0.204 by @lahma in #5172
  • Better support for reading yaml from a stream (part two) by @simonthum in #5171
  • Avoid multiple enumeration of array typed path parameters by @Khyalis in #5149
  • Restores all disabled compiler warnings. 649 and 8765 were missing. by @carlbjorknas in #4962
  • Fix to explode array parameters implicitly when SchemaType is OpenAPI 3.0 by @Phoosha in #5176
  • Adding cancellationToken to all calls to ReadAsStringAsync() and ReadAsStreamAsync() by @arshrp in #5187
  • Remove requirement for specific NET SDK in GH Actions by @lahma in #5188
  • Adjusted cancellationToken to work for all NSwag supported frameworks by @arshrp in #5190
  • Allow setting of the client interface access modifier based on the model access modifier by @pbolduc in #4820
  • Prioritize wildcard over json over first entry for accept content-type by @mdi1984 in #5198
  • Reduce interface dispatch to improve performance by @lahma in #5199
  • Surface ExtensionData in CSharpControllerTemplateModel by @hirudan in #5204
  • Expose the UseRequiredKeyword on CSharpClientGeneratorSettings for CSharp client generator by @r-englund in #5205
  • Fix to expose an optional param for AbortSignal (for axios) / CancelToken (for fetch) when GenerateClientInterfaces = true by @tomvdk in #5202
  • Sort client operation responses by status code by @lahma in #5206
  • TSC UpdateUseDtoClassAndDataConversionCodeProperties cleanup by @lahma in #5212
  • Update Microsoft.AspNetCore.* references to target 2.3.0 by @lahma in #5214
  • Convert to using Central Package Management by @lahma in #5217
  • Convert NSwagStudio setup to use WiX 6 by @lahma in #5218
  • Add support for TypeScript compilation testing by @lahma in #5219
  • Replace TypeScript string contain asserts with Verify tests by @lahma in #5220
  • Replace C# string contain asserts with Verify tests by @lahma in #5221
  • Remove deprecated tslint suppression by @CaringDev in #5020
  • Fix empty enumerable parameter handling in C# client by @lahma in #5222
  • Fix: C# Code Generation generates method with return default(void) by @nzeemin in #4826
  • Optimize DefaultParameterNameGenerator and add some more char cleanup by @lahma in #5223
  • Convert more tests to use verify by @lahma in #5224
  • Convert to xUnit v3 by @lahma in #5225
  • Ensure operation names start with alphanumeric character by @lahma in #5227
  • Change GenerateSampleSpecificationTests to auto verify mode by @lahma in #5228
  • Show DisplayName for conflicting actions by @Saibamen in #5057
  • Fix: When generated TS class name is "Error", it is conflicting with TS Error class by @doruk-info in #5032
  • Update NJsonSchema to 11.4.0, update testsuite to reflect a change in class name generation by @WolfgangHG in #5177
  • Improve nswag.js parameter handling by @KaterSchnurz in #5232
  • Use TypeScript 4.3 as default testing version by @lahma in #5234
  • v14.5.0 by @RicoSuter in #5236

New Contributors

Full Changelog: v14.4.0...v14.5.0

NSwag v14.4.0 (NJsonSchema v11.3.2)

Choose a tag to compare

@RicoSuter RicoSuter released this 28 Apr 22:03

What's Changed

  • Fix optional parameter ordering in generated TS/CS clients by @lahma in #5135
  • Add MSBuildProjectDirectory fallback to ProjectDir resolution by @lahma in #5146
  • Tolerate missing schema in OperationModelBase.GetActualParameters by @lahma in #5147
  • Improve OpenApiOperation ActualResponses and Responses performance by @lahma in #5148
  • Optimize OpenApiDocument.GenerateOperationIds by @lahma in #5150
  • Optimize MultipleClientsFromOperationIdOperationNameGenerator duplicate checks by @lahma in #5151
  • Fix some string API usage by @lahma in #5152
  • Add NET 8 targets to core libraries by @lahma in #5153
  • Optimize ObservableDictionary.CollectionChanged by @lahma in #5154
  • Fix array parameter explosion check by @lahma in #5158
  • Include each client type in JIRA OpenAPI Verify testing by @lahma in #5160
  • Update to NJsonSchema v11.3.2 & Namotion.Reflection v3.4.2 by @RicoSuter in #5161
  • Upgraded Microsoft.Extensions.ApiDescription.* to 8.0.14 by @ntyrrell in #5121
  • Add support for STJ-native C# code gen by @mac-michael in #5155
  • Update to Swagger UI v5.21.0 by @RicoSuter in #5162

New Contributors

Full Changelog: v14.3.0...v14.4.0

NSwag v14.3.0 (NJsonSchema v11.2.0)

Choose a tag to compare

@RicoSuter RicoSuter released this 29 Mar 16:17

Updated to NJsonSchema v11.2.0, see https://github.com/RicoSuter/NJsonSchema/releases/tag/v11.2.0

What's Changed

New Contributors

Full Changelog: v14.2.0...v14.3.0