Skip to content

A powerful and lightweight library designed to provide OpenAPI and Swagger UI support in .NET.

License

Notifications You must be signed in to change notification settings

xC0dex/APIWeaver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

98 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

APIWeaver

Pipeline Coverage NuGet Version NuGet Downloads

APIWeaver is a powerful and lightweight library designed to provide a seamless integration of OpenAPI and Swagger UI into your .NET 6+ apps. APIWeaver supports the latest .NET features and is designed to be future-proof, ensuring support for upcoming .NET and OpenAPI features.

Announcement

Microsoft is planning a built-in solution for generating OpenAPI documents. APIWeaver is focusing on API client generation.

Getting Started

To get started with APIWeaver, you can install the NuGet package using your preferred package manager. In most cases, the package APIWeaver.Swagger is the one you are looking for.

  1. Install the NuGet package
dotnet add package APIWeaver.Swagger
  1. Add the using directive to your Program.cs file
using APIWeaver;
  1. Add the following lines to your Program.cs file.
builder.Services.AddApiWeaver();

// other code

if (app.Environment.IsDevelopment())
{
    app.UseSwaggerUi();
}

That's it. You now have a fully functional Swagger UI in your application. The UI can be accessed by navigating to /swagger in your browser 🥳. A more detailed guide with more use cases can be found here.

Currently supported features

  • Fully functional and configurable Swagger UI (with dark mode 🌙)
  • OpenAPI 3.0 generation
  • OpenAPI generation based on minimal APIs and controllers
  • .NET 6, 7 and 8 including required members, nullable types and latest validation attributes
  • System.Text.Json including serializer options like IncludeFields, IgnoreReadOnlyFields, IgnoreReadOnlyProperties and more
  • Custom transformers to modify the generated OpenAPI document asynchronously

Roadmap

  • API client generation based on the generated OpenAPI document

Work in progress

This project is currently under active development, with ongoing improvements, new features and potential API changes. If you have any feedback, feature requests or issues, please feel free to open an issue or a pull request.

Contribution and Collaboration

Your contributions to this project are welcomed and encouraged. Your active involvement can significantly impact its success!

License

Distributed under the MIT License. See LICENSE for more information. This means APIWeaver will always remain free.

About

A powerful and lightweight library designed to provide OpenAPI and Swagger UI support in .NET.

Resources

License

Stars

Watchers

Forks