Skip to content

zandiarash/Arshid-Aspire-ApiDocs-Extensions

Repository files navigation

Arshid Aspire ApiDocs Extensions

Arshid.Aspire.ApiDocs.Extensions Arshid.Aspire.ApiDocs.Extensions Arshid.Aspire.ApiDocs.Extensions

An extension to add Swagger, OpenApi, Scalar, CustomUrl and CustomRoute to .Net Aspire dashboard for API, Blazor and any other app. You can have ApiDocs and also your custom links in your .Net Aspire Dashboard like this :

AspireDashboard

Getting Started

Installation

Simply install this nuget package Arshid.Aspire.ApiDocs.Extensions to your AppHost.csproj

dotnet add package Arshid.Aspire.ApiDocs.Extensions

Nuget Package

Then add these lines for the project that has Swagger, Scalar or etc.

📦 Example

using Arshid.Aspire.ApiDocs.Extensions;

var apiService = builder.AddProject<Projects.AspireApp1_ApiService>("apiservice")
    .WithScalar()
    .WithSwagger()
    .WithOpenApi()
    .WithCustomUrl("https://127.0.0.1:5000/CustomRoute/CustomPage1")
    .WithRoute("/CustomRoute/CustomPage2"); //The URL become something like this {protocol}://{url}:{port}/CustomRoute/CustomPage2

Usage

If you are not familiar with Swagger, Scalar, OpenApi and similar tools please read from this article :

net-9-revolutionizing-documentation-of-apis-from-swashbuckle-to-scalar

🤝 Contributing is welcome

If you would like to contribute, please feel free to create a Pull Request.

About

An extension to add Swagger, OpenApi, Scalar, CustomUrl and CustomRoute to .Net Aspire.

Resources

License

Stars

Watchers

Forks

Packages

No packages published