IGeekFan.AspNetCore.RapiDoc 0.0.4

There is a newer version of this package available.
See the version list below for details.
dotnet add package IGeekFan.AspNetCore.RapiDoc --version 0.0.4
NuGet\Install-Package IGeekFan.AspNetCore.RapiDoc -Version 0.0.4
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="IGeekFan.AspNetCore.RapiDoc" Version="0.0.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add IGeekFan.AspNetCore.RapiDoc --version 0.0.4
#r "nuget: IGeekFan.AspNetCore.RapiDoc, 0.0.4"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install IGeekFan.AspNetCore.RapiDoc as a Cake Addin
#addin nuget:?package=IGeekFan.AspNetCore.RapiDoc&version=0.0.4

// Install IGeekFan.AspNetCore.RapiDoc as a Cake Tool
#tool nuget:?package=IGeekFan.AspNetCore.RapiDoc&version=0.0.4

IGeekFan.AspNetCore.RapiDoc

RapiDoc Custom Element for Open-API spec viewing ,Support .NET Core3.1 、.NET Standard2.0、.NET5.0。

nuget stats GitHub license

中文

An API document that implements swagger 2.0 and OpenAPI 3.0. I integrate it into aspnetcore。

Features

  • Supports Swagger 2.0 and OpenAPI 3.0
  • Works with any framework or with no framework
  • Allows making API calls. And More....
  • For more features, please refer to RapiDoc README

Dependencies

RapiDoc

Swashbuckle.AspNetCore

  • Swashbuckle.AspNetCore.Swagger
  • Swashbuckle.AspNetCore.SwaggerGen

Demo

📚 QuickStart

🚀 Install Package

use Swashbuckle.AspNetCore.Swagger Components

1.Install the standard Nuget package into your ASP.NET Core application.

Package Manager : 

Install-Package Swashbuckle.AspNetCore.Swagger
Install-Package Swashbuckle.AspNetCore.SwaggerGen
Install-Package IGeekFan.AspNetCore.RapiDoc

OR

CLI :

dotnet add package Swashbuckle.AspNetCore.Swagger
dotnet add package Swashbuckle.AspNetCore.SwaggerGen
dotnet add package IGeekFan.AspNetCore.RapiDoc

2.In the ConfigureServices method of Startup.cs, register the Swagger generator, defining one or more Swagger documents.

using Microsoft.AspNetCore.Mvc.Controllers
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen;
using IGeekFan.AspNetCore.RapiDoc;

🚁 ConfigureServices

3.Services Configure

   services.AddSwaggerGen(c =>
    {
        c.SwaggerDoc("v1",new OpenApiInfo{Title = "API V1",Version = "v1"});
        var filePath = Path.Combine(System.AppContext.BaseDirectory $"{typeof(Startup).Assembly.GetName().Name}.xml");
        c.IncludeXmlComments(filePath, true);
    });

💪 Configure

  1. Middleware Configure
app.UseSwagger();

app.UseRapiDocUI(c =>
{
    c.RoutePrefix = ""; // serve the UI at root
    c.SwaggerEndpoint("/v1/api-docs", "V1 Docs");
});

app.UseEndpoints(endpoints =>
{
    endpoints.MapControllers();
    endpoints.MapSwagger("{documentName}/api-docs");
});

🔎 Views

Run Project,Open WebSite https://localhost:5001/index.html#/home

docs/images/view.png

5.More Configure

To add comments to a document, right-click on the project - properties - generate

alternate text is missing from this package README image

In AddSwaggerGen Methods You should add this methond

c.IncludeXmlComments(Path.Combine(AppContext.BaseDirectory, "SwaggerDemo.xml"),true);

The last parameter is set to true to enable comments on the controller

NSwag.AspNetCore

Another way

Please refer to the table of contents test/WebSites/NSwag.Swagger.RapiDoc

Package Manager : 

Install-Package IGeekFan.AspNetCore.RapiDoc

OR

CLI :

dotnet add package NSwag.AspNetCore
public void ConfigureServices(IServiceCollection services)
 {
    // 其它Service
     services.AddOpenApiDocument();
 }
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
        // 其它 Use
      app.UseOpenApi();
      app.UseRapiDocUI(c =>
     {
           c.RoutePrefix = "";
           c.SwaggerEndpoint("/swagger/v1/swagger.json");
      });
}

Every Things is Ok. Now, You can visist RapiDoc

More Configure

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 is compatible. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on IGeekFan.AspNetCore.RapiDoc:

Package Downloads
IGeekFan.AspNetCore.RapiDoc.Extra

Middleware to expose an embedded version of the RapiDoc from an ASP.NET Core application And support Filter

IGeekFan.FreeKit.Infrastructure

基础包功能模块

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on IGeekFan.AspNetCore.RapiDoc:

Repository Stars
luoyunchong/lin-cms-dotnetcore
😃A simple and practical CMS implemented by .NET + FreeSql;前后端分离、Docker部署、OAtuh2授权登录、自动化部署DevOps、自动同步至Gitee、代码生成器、仿掘金专栏
Version Downloads Last updated
0.0.7 21,182 3/24/2023
0.0.6 375 3/20/2023
0.0.5 23,928 12/16/2021
0.0.4 878 9/2/2021
0.0.3 961 5/8/2021
0.0.2 350 4/25/2021
0.0.1 836 3/30/2021