Matchup

Microsoft Kiota vs NSwag

A choice .NET teams often face: both are free and open source, and both write C# and TypeScript clients from an OpenAPI description. Kiota builds a fluent client on Microsoft's shared core libraries (the Microsoft.Kiota.Bundle package in .NET), with pluggable authentication providers and a default retry handler. NSwag writes client classes you call with your own HttpClient, and the same toolchain can produce the description from your ASP.NET Core controllers.

vs
Criteria

Tick what matters. ×2 counts a criterion double.

Verdict

Microsoft Kiota wins, 14 to 9, over NSwag.

Microsoft Kiota 14/18 NSwag 9/18

Microsoft Kiota takes language support, typing, auth handling and retries. Even on error handling and maintenance.

CriterionMicrosoft KiotaNSwag
Language supportEdge: Microsoft KiotaSolid

Its docs list C#, Go, Java, PHP, Python, Ruby and TypeScript. Check the language support page for each one's maturity.

Check: Kiota overview
Partial

Two client languages: C#, and TypeScript with templates for Fetch, Axios (preview), Angular, AngularJS, Aurelia and jQuery. Callers in any other language need another generator.

Check: NSwag README
TypingEdge: Microsoft KiotaStrong

Its docs describe strongly typed clients with models generated from the JSON Schema in your description, and IDE autocomplete for every resource.

Check: Kiota overview
Solid

Typed C# DTOs and TypeScript classes or interfaces come from the schemas through NJsonSchema, which documents its handling of enums and inheritance. Check how oneOf comes through for your description.

Check: NSwag README
Auth handlingEdge: Microsoft KiotaSolid

Auth plugs in through authentication providers on the request adapter; an authorization handler ships for some languages only.

Check: Kiota middleware handlers
Partial

Security schemes don't become client configuration. You add the Authorization header yourself: an injected HttpClient or the PrepareRequest hook in C#, a base class with transformOptions in TypeScript.

Check: NSwag: TypeScript client generator
RetriesEdge: Microsoft KiotaStrong

A retry handler for 429 and 503 responses is on by default in the C#, Go, Java, TypeScript, PHP and Python HTTP libraries; not in Ruby.

Check: Kiota middleware handlers
Partial

No retry logic is generated. The C# client takes an injected HttpClient, so retries come from whatever handlers you configure on it; in TypeScript you wrap the calls yourself.

Check: NSwag: C# client generator settings
Error handlingEvenSolid

Error responses described in your API become error models the client can raise. Check how your language surfaces them.

Check: Kiota overview
Solid

Exception classes are generated by default and carry the status code, response body and headers; documented error responses with a schema come back as a typed result on the exception.

Check: NSwag: C# client generator settings
MaintenanceEvenSolid

Regenerate from the description; the generated code stays small because shared behaviour lives in versioned core libraries you also keep up to date.

Check: Kiota overview
Solid

One .nswag configuration file regenerates the clients from the CLI, an npm package or an MSBuild target, and the same toolchain can produce the description from your ASP.NET Core controllers. Check its releases page for recent activity.

Check: NSwag: C# client generator

The verdict, and when to ignore it

Microsoft Kiota wins, 14 to 9, over NSwag. Microsoft Kiota takes language support, typing, auth handling and retries. Even on error handling and maintenance.

Pick Microsoft Kiota when

Your clients need retries and pluggable auth without hand-written handlers, you call large APIs and want to generate only the paths you use, or callers also need Go, Java, PHP, Python or Ruby. Check Kiota's docs for each language's maturity.

Kiota on Microsoft Learn

Pick NSwag when

Your API is ASP.NET Core, you only need C# and TypeScript, and you want the description and both clients regenerated from one .nswag file in your build, with no Kiota core libraries to keep up to date.

NSwag on GitHub