Repository navigation
Releases
NSwag v14.8.0 (NJsonSchema v11.6.2)
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)inNSwag.MSBuild/runtime:Net110in the command line tool, thenswagNPM package (the legacy--core 11.0form also works) and NSwagStudio- A
Net110folder in the MSBuildtools/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: trueinstead of silently losing their declared nullability (NJsonSchema#1931). This applies when the property is marked required by a presence-only marker — the C#requiredkeyword,[JsonRequired],[DataMember(IsRequired = true)]or NewtonsoftRequired.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 therequiredkeyword, 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.*fornet462/netstandard2.0: 2.3.0 (Kestrel.Core 2.3.6) → 2.3.14Microsoft.AspNetCore.OpenApiand.TestHost: 8.0.34, 9.0.23, 10.0.15 and 11.0.0 per target framework- Build-only:
System.Security.Cryptography.Xmland.Pkcs→ 10.0.15
Other changes
- The release binaries (
NSwag.zipandNSwagStudio.msi) are now attached to the GitHub release automatically by the tagged build. - A hang in project metadata lookup was fixed:
dotnet msbuild --getPropertyoutput 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)
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=1on non-nullable strings. - DataAnnotations
[Required]semantics remain unchanged (still suppresses nullability and addsMinLength=1to 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
- Upgrade to NJsonSchema v11.6.1 (NSwag v14.7.1) by @RicoSuter in #5367 (fixes #5359)
Full Changelog: v14.7.0...v14.7.1
NSwag v14.7.0 (NJsonSchema v11.6.0)
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.Npmresulting in aNConsole.UnusedArgumentExceptionby @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
requiredkeyword now correctly recognized: Properties using the C# 11requiredkeyword (viaRequiredMemberAttribute/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
WriteAccessorsetting to control property setter syntax (setvsinit). - New
JsonLibraryVersionsetting for controlling enum attribute generation with System.Text.Json. - Fixed
MinLengthvalidation 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
IncludeFieldsis enabled.
For the full list of changes, see the NJsonSchema v11.6.0 release notes.
New Contributors
- @ptasev made their first contribution in #5320
- @MeikelLP made their first contribution in #5337
- @adnanalbeda made their first contribution in #5283
- @copyleftproducts made their first contribution in #5315
- @Copilot made their first contribution in #5348
Full Changelog: v14.6.3...v14.7.0
NSwag v14.6.3 (NJsonSchema v11.5.2)
What's Changed
- Using final .NET 10 libraries/SDK and minor .NET 10 fixes (v14.6.3) by @RicoSuter in #5307
- Updated packages for CVE-2025-55315 by @erjdev in #5299
- fix: nswag.js try detect the runtime version from config file by @dylanvdmerwe in #5302
New Contributors
- @erjdev made their first contribution in #5299
- @dylanvdmerwe made their first contribution in #5302
Full Changelog: v14.6.2...v14.6.3
NSwag v14.6.2 (NJsonSchema v11.5.2)
Fixes EnumValue regression in v14.6.1 by introducing a new JsonLibraryVersion configuration (default 8.0)
What's Changed
- v14.6.2: Update NJS and update commands/UI & update .NET 10 SDK (RC2) by @RicoSuter in #5298
- Update NJsonSchema to v11.5.2 (with revert to previous EnumValue behavior and new config)
Full Changelog: v14.6.1...v14.6.2
NSwag v14.6.1 (NJsonSchema v11.5.1)
What's Changed
- Fix binary operation result type generation for AspNetCore CSharp by @xamele0n in #5255
- Update NJsonSchema to v11.5.1 by @RicoSuter in #5279
- fix: Support web host (legacy) in ServiceProviderResolver by @RicoSuter in #5278
New Contributors
Full Changelog: v14.6.0...v14.6.1
NSwag v14.6.0 (NJsonSchema v11.5.0)
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
- @htuomola made their first contribution in #5243
- @jsclifford made their first contribution in #5240
- @amayouf made their first contribution in #5248
- @etriebe made their first contribution in #5235
Full Changelog: v14.5.0...v14.6.0
NSwag v14.5.0 (NJsonSchema v11.4.0)
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
- @simonthum made their first contribution in #5170
- @thompson-tomo made their first contribution in #4831
- @Khyalis made their first contribution in #5149
- @carlbjorknas made their first contribution in #4962
- @Phoosha made their first contribution in #5176
- @arshrp made their first contribution in #5187
- @pbolduc made their first contribution in #4820
- @mdi1984 made their first contribution in #5198
- @hirudan made their first contribution in #5204
- @r-englund made their first contribution in #5205
- @CaringDev made their first contribution in #5020
- @nzeemin made their first contribution in #4826
- @doruk-info made their first contribution in #5032
- @WolfgangHG made their first contribution in #5177
- @KaterSchnurz made their first contribution in #5232
Full Changelog: v14.4.0...v14.5.0
NSwag v14.4.0 (NJsonSchema v11.3.2)
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
- @ntyrrell made their first contribution in #5121
- @mac-michael made their first contribution in #5155
Full Changelog: v14.3.0...v14.4.0
NSwag v14.3.0 (NJsonSchema v11.2.0)
Updated to NJsonSchema v11.2.0, see https://github.com/RicoSuter/NJsonSchema/releases/tag/v11.2.0
What's Changed
- Fix EnableTryItOut UI option by @Saibamen in #5031
- Add analysis rules and relaxations by @lahma in #5036
- Seal private/internal types and make methods static when applicable by @lahma in #5037
- Add GitHub issues templates by @lahma in #5038
- Use Count instead of using Any() by @lahma in #5039
- Enable implicit usings and remove unused by @lahma in #5040
- Fix some code style issues by @lahma in #5041
- Use TryGetValue() and Any() when possible by @lahma in #5042
- Simplify using statements by @lahma in #5043
- Simplify collection initialization by @lahma in #5044
- Use pattern matching by @lahma in #5045
- Use compound assignment by @lahma in #5046
- Simplify collection initialization and use pattern matching by @lahma in #5047
- Remove unnecessary member initialized to its default value by @lahma in #5048
- Add braces to if statements and ensure correct use of variables by @lahma in #5049
- Fix string usage problems reported by analyzers by @lahma in #5050
- Remove unused usings by @lahma in #5051
- Use expression bodies for properties and accessors by @lahma in #5053
- Fix some code formatting issues by @lahma in #5054
- Only run publish when in main repository by @lahma in #5055
- Update
Microsoft.NET.Tests.SdkandVerify.XUnitby @Saibamen in #5059 - Upgrade to NUKE 9 by @lahma in #5052
- Remove NET 6.0 from GitHub Actions by @lahma in #5083
- jsonschema2csclient GenerateNativeRecords argument by @jokarls in #5082
- Fix analyzer issues and remove obsolete NoWarn items by @lahma in #5119
- Remove Microsoft.Extensions.PlatformAbstractions by @lahma in #5058
- Upgrade to NUKE 9.0.4 by @lahma in #5120
- Import dayjs with the default named import by @Seveilith in #4813
- Inheritdoc for ApiDescription by @Saibamen in #5064
- Allow SwaggerUiIndexMiddleware to work with ReDocSettings by @miloszkukla in #5122
- Upgrade NJsonSchema to 11.3.0 & Namotion.Reflection by @RicoSuter in #5128
- Fix for unwanted parameter explosion in C# client by @simonnieder in #5016
- Fix for #3414 - C# generated client using FormUrlEncodedContent instead of StringContent by @ErikApption in #5029
- fix media type on empty request body by @jamesmanningrapidscale in #5068
- Suppress compiler warnings for possible nulls in generated code by @velvolue in #5099
- Update to Swagger UI v5.20.2 by @RicoSuter in #5129
New Contributors
- @Saibamen made their first contribution in #5031
- @jokarls made their first contribution in #5082
- @Seveilith made their first contribution in #4813
- @miloszkukla made their first contribution in #5122
- @simonnieder made their first contribution in #5016
- @ErikApption made their first contribution in #5029
- @jamesmanningrapidscale made their first contribution in #5068
- @velvolue made their first contribution in #5099
Full Changelog: v14.2.0...v14.3.0