Skip to content

chenkaibin/NSwag

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 

Repository files navigation

NSwag: The Swagger API toolchain for .NET

Build status

NSwag is a Swagger 2.0 API toolchain for .NET, TypeScript and other platforms, written in C#. The Swagger specification uses JSON and JSON Schema to describe a RESTful web API. The project provides tools to automatically generate client code from these Swagger specifications and integrate this generation into existing processes.

Swagger Generators:

Client Generators:

Read more about the available Swagger and Client Generators

Ways to use the toolchain:

Downloads and Build Artifacts (command line tool and NSwagStudio)

This project uses NJsonSchema for .NET for JSON Schema generation.

Usage in C#

The following code shows how to generate C# client classes to call a web service:

var service = SwaggerService.FromJson("...");

var generator = new SwaggerToCSharpGenerator(service);
generator.Class = "MyClass";
generator.Namespace = "MyNamespace";

var code = generator.GenerateFile();

About

NSwag: The Swagger API toolchain for .NET

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 78.6%
  • JavaScript 11.2%
  • TypeScript 9.9%
  • Other 0.3%